我的Django模板位置列为:
python\Lib\site-packages\django\contrib\auth\templates
在我看来,我有:
return render_to_response('hello.html', {'name': name})
当我将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