簡體   English   中英

Django 模板 DIRS TemplateDoesNotExist:為什么有些模板被跳過(Skipped)?

[英]Django Template DIRS TemplateDoesNotExist: Why are some templates being skipped (Skipped)?

我正在嘗試django-scheduler的示例項目。 當我嘗試加載 127.0.0.1 時,它會為base.html拋出TemplateDoesNotExist 調試 = 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 實際存在)它顯示(跳過)。 為什么他們被跳過了?

謝謝@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 %}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM