【发布时间】:2020-01-28 14:39:50
【问题描述】:
我正在试用django-scheduler 的示例项目。当我尝试加载 127.0.0.1 时,它会为 base.html 抛出 TemplateDoesNotExist。 Debug = True 说:
Django tried loading these templates, in this order:
Using engine django:
django.template.loaders.filesystem.Loader: D:\Code\django-calendar-sample\django-scheduler-sample\project_sample\templates\base.html (Skipped)
django.template.loaders.filesystem.Loader: D:\Code\django-calendar-sample\django-scheduler-sample\project_sample\templates\base.html (Skipped)
django.template.loaders.app_directories.Loader: C:\ProgramData\Anaconda3\lib\site-packages\django\contrib\auth\templates\base.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\ProgramData\Anaconda3\lib\site-packages\django\contrib\admin\templates\base.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\ProgramData\Anaconda3\lib\site-packages\debug_toolbar\templates\base.html (Source does not exist)
django.template.loaders.app_directories.Loader: D:\Code\django-calendar-sample\django-scheduler-sample\project_sample\templates\base.html (Skipped)
注意它显示的前两行的最后(base.html 实际存在的地方)(已跳过)。为什么他们被跳过了?
【问题讨论】:
-
你有一个递归错误。
django-scheduler-sample\project_sample\templates\base.html本身会尝试扩展base.html,除非您提供一个单独的base.html,否则它可以从其扩展。
标签: python django django-scheduler