我的Django的模板位置被列为:TemplateDoesNotExist Django的
python\Lib\site-packages\django\contrib\auth\templates
在我看来,我有:
当我继续在此位置hello.html
它的工作
python\Lib\site-packages\django\contrib\auth\templates
虽然我保留模板位置为
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates'),
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.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',
],
},
},
]
NewProject
-NewProject
settings.py
-signups
view.py
def hello(request):
name='vijay'
return render_to_response('hello.html',{'name':name})
templates
hello.html
而不是说不起作用,为什么你不仔细看堆栈跟踪看看它说什么,如果你需要帮助,将它添加到问题。 – e4c5
@ user1844634什么是django版本? –
我正在使用1.8.4 – user1844634