Windows Django2.1 报错 TemplateDoesNotExist

折腾了一个小时,没有搞明白为什么。

后面处理好了:

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值