折腾了一个小时,没有搞明白为什么。
后面处理好了:
Template-loader postmortem
Django tried loading these templates, in this order:
Using engine django
:
django.template.loaders.app_directories.Loader
: C:\Program Files (x86)\Python37-32\lib\site-packages\django\contrib\admin\templates\polls\templates\index.html (Source does not exist)django.template.loaders.app_directories.Loader
: C:\Program Files (x86)\Python37-32\lib\site-packages\django\contrib\auth\templates\polls\templates\index.html (Source does not exist)django.template.loaders.app_directories.Loader
: E:\01_CPorject\2018\HelloWorld\polls\templates\polls\templates\index.html (Source does not exist)
原来是我的template路径写错了!
return render(request,'polls/templates/index.html')
# return render(request,'index.html')
修改为注释那行即可!
如果admin后台看不到:
OperationalError at /admin/
no such table: django_session
请使用python managy.py migrate执行一遍,然后再runserver