更新时间:2023-11-17 23:00:46
更改
import os.path
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
到
import os
SITE_ROOT = os.path.dirname(os.path.dirname(__file__))
如果您查看回溯,Python会在您的app文件夹中寻找一个模板文件夹,我认为它与settings.py所在的文件夹相同.
If you look at your traceback, Python is looking for a template folder within your app folder, I assume that it would be the same folder as settings.py.
另一种方法是将模板文件夹复制到MyDjangoAPP文件夹中.
Another approach is to copy your templates folder into MyDjangoAPP folder.