我正在尝试django-scheduler的示例项目。当我尝试加载127.0.0.1时,它将为TemplateDoesNotExist
抛出base.html
。 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的末尾)(已跳过)。他们为什么被跳过?
答案 0 :(得分:0)
感谢@solarissmoke你是正确的;
在base.html
中:
{% extends "base.html" %}
{% load i18n %}
{% block extra_head %}
{{ block.super }}
{% endblock %}
{% block rtab_id %}id="schedule_tab"{% endblock %}
{% block subnav %}
<ul>
{% if user.is_authenticated %}
<li><a href="">{% trans "Create a Calendar" %}</a></li>
<li><a href="">{% trans "Your Calendars" %}</a></li>
{% endif %}
<li><a href="">{% trans "All Calendars" %}</a></li>
</ul>
{% endblock %}