twms polls migrations static templates project migrations static templates project index.html tmws static templates tmws base.html
这是project/templates/project/index.html的代码。
{% extends 'tmws/base.html' %}
{% block content %}
<h1>Projects</h1>
<ul>
{% for project in project_list %}
<li><a href="{% url 'project:detail' project.id %}">{{ project.name }}</a></li>
{% endfor %}
</ul>
end of list
{% endblock %}
我收到的错误是:
TemplateDoesNotExist at /project/
tmws/base.html
如何从我的任意应用程序中访问tmws/tmws/templates/tmws/base.html?
非常感谢您提供任何帮助!
如果需要任何其他信息,请告诉我。
编辑
以下是我的设置.py中的模板设置:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, 'templates'), # If i leave both or just comment one one out I still get the same error
'tmws.tmws.templates'
],
'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',
],
},
},
]