Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 python 代码,它从用户那里获取很少的输入并给出输出。它不需要任何数据库。现在我想使用 django 构建一个 Web 界面。我想知道如何在不使用任何数据库的情况下将 python 代码集成到 django 的 web 界面。
您不需要使用数据库。只需将 Python 代码写入视图并将输出放入传递给渲染函数的字典中。
视图.py:
def my_view(request): # Do stuff and set value return render_to_response('my_page.html', {'value': value}, context_instance=RequestContext(request))