Ali*_*Ali 5 django operational cursor python-3.x
错误的子标题是:
“模板渲染时出错
在 .../base.html 第 0 行的错误
游标“_django_curs_139683611834112_1”不存在
目前在运行带有 docker 的 Ubuntu 的服务器上使用 Django 2.0 和 Python 3.6。通过以下流加载空白 URL 时发生错误:
网址.py:
from dashboard2.account_views_new import AccountView
'''urlpatterns = [
url(r'^$', AccountView.as_view(), name='home'),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Run Code Online (Sandbox Code Playgroud)
意见:
class AccountView(TemplateView):
template_name = 'fv1/dash_nav.html'
def get(self, request):
this_form = forms.ThisForm()
that_form = forms.ThatForm()
forms = Form.objects.all()
things = Things.objects.all()
return render(request, self.template_name)
def post(self, request):
this = that1.objects.all()
that = this1.objects.all()
return render(request, self.template_name, {data})
Run Code Online (Sandbox Code Playgroud)
base.html(在第 0 行抛出错误):
<!-- update this to include headers and such in jynja -->
<!DOCTYPE html>
<html lang="en">
{% load static %}
<head>
Run Code Online (Sandbox Code Playgroud)
是什么产生了这个错误?
小智 0
这个问题最简单的解决方案
$Python manage.py makemigrations$Python manage.py migrate| 归档时间: |
|
| 查看次数: |
460 次 |
| 最近记录: |