问题描述
TemplateDoesNotExist
问题出现的环境背景及自己尝试过哪些方法
查了不下50个网页,包括Google,stackoverflow等等
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
TemplateDoesNotExist at /single/433
show_content/省略/433.html
Request Method: GET
Request URL: 省略
Django Version: 2.1.1
Exception Type: TemplateDoesNotExist
Exception Value:
show_content/省略/433.html
Exception Location: /usr/local/lib/python3.6/dist-packages/django/template/loader.py in get_template, line 19
Python Executable: /usr/local/bin/uwsgi
Python Version: 3.6.3
Python Path:
['.',
'',
'/usr/lib/python36.zip',
'/usr/lib/python3.6',
'/usr/lib/python3.6/lib-dynload',
'/usr/local/lib/python3.6/dist-packages',
'/usr/lib/python3/dist-packages']
Server time: Sat, 20 Oct 2018 05:49:20 +0000
Template-loader postmortem
Django tried loading these templates, in this order:
Using engine django:
django.template.loaders.filesystem.Loader: /home/zhixing/templates/show_content/新浪/433.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/dist-packages/django/contrib/admin/templates/show_content/省略/433.html (Source does not exist)
django.template.loaders.app_directories.Loader: /usr/local/lib/python3.6/dist-packages/django/contrib/auth/templates/show_content/省略/433.html (Source does not exist)
奇葩之处在于,ubuntu 上权限没问题,错误页面显示的路径完全正确,我甚至能直接粘贴从xftp上打开这路径。
项目发布到服务器前,是在win10上开发,一切正常,该修改的地方都修改了。包括继承模板的路径。
项目用的是 Ubuntu14 + nginx + uwsgi + django
TEMPLATES 下面的DIRS有没有忘记加以下类似的路径?