Python 模板不存在-Django

Python 模板不存在-Django,python,django,templates,path,Python,Django,Templates,Path,我试图通过扩展base.html来创建index.html。问题是,Django说没有这样的模板。它找不到它。我已经尝试了更多的方法,但没有一种有效 这是我的项目结构: upload/templates/upload/index.html: {% extends 'base.html' %} {% block content %} <form action="/process_text/" method="post" enctype="multipart/form-data"&g

我试图通过扩展
base.html
来创建
index.html
。问题是,
Django
说没有这样的模板。它找不到它。我已经尝试了更多的方法,但没有一种有效

这是我的项目结构:

upload/templates/upload/index.html:

{% extends 'base.html' %}
{% block content %}
    <form action="/process_text/" method="post" enctype="multipart/form-data">{% csrf_token %}
        {{ lang_drop_down_form }}
        <br>
        {{ text_area_form }}
        {{ file_upload_form }}
        <input align="center" type="submit" value="upload">
    </form>

    {% if user.is_authenticated %}
    <p>Hello {{ user.name }}</p>
    {% endif %}
{% endblock %}

您知道该怎么做吗?

您需要将扩展标记更改为:

{% extends 'uploading/base.html' %}

模板位于
upload/templates/upload/base.html
中。app template dir是
uploading/templates
,因此在Django中引用它时,您需要使用剩余的
uploading/base.html

在您的settings.py中,应该有用于模板的文件夹的名称。这是哪一个?只有这个:TEMPLATES=[{'BACKEND':'django.template.backends.django.django.DjangoTemplates','DIRS':[],'APP_DIRS':True,'OPTIONS':{'context_processors':['django.template.context_processors.debug','django.template.context_processors.request','django.contrib.auth.context_processors.auth','django.contrib.messages.context_processors.messages',],},},]
TemplateDoesNotExist at /
mysite/uploading/templates/uploading/base.html
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Django Version: 1.8.7
Exception Type: TemplateDoesNotExist
Exception Value:    
mysite/uploading/templates/uploading/base.html
Exception Location: C:\Python27\lib\site-packages\django\template\engine.py in find_template, line 146
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.10
Python Path:    
['C:\\Users\\Milano\\PycharmProjects\\mysite',
 'C:\\Windows\\SYSTEM32\\python27.zip',
 'C:\\Python27\\DLLs',
 'C:\\Python27\\lib',
 'C:\\Python27\\lib\\plat-win',
 'C:\\Python27\\lib\\lib-tk',
 'C:\\Python27',
 'C:\\Python27\\lib\\site-packages',
 'C:\\Python27\\lib\\site-packages\\win32',
 'C:\\Python27\\lib\\site-packages\\win32\\lib',
 'C:\\Python27\\lib\\site-packages\\Pythonwin']
Server time:    Sun, 20 Dec 2015 15:08:11 +0100
{% extends 'uploading/base.html' %}