我收到以下消息。我有点明白我的项目服务器找不到模板。但是,我不知道它到底在抱怨什么模板。很高兴听到对正在发生的事情的替代解释。
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/polls/1/
Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
'django.contrib.admin')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/stanley/mytemplates/polls/detail.html, polls/poll_detail.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/polls/detail.html, polls/poll_detail.html (File does not exist)
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/polls/detail.html, polls/poll_detail.html (File does not exist)
Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
136. response = response.render()
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in render
104. self._set_content(self.rendered_content)
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in rendered_content
79. template = self.resolve_template(self.template_name)
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in resolve_template
55. return loader.select_template(template)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py" in select_template
193. raise TemplateDoesNotExist(', '.join(not_found))
Exception Type: TemplateDoesNotExist at /polls/1/
Exception Value: polls/detail.html, polls/poll_detail.html