我正在从[THIS] [1]教程学习Django.一切都很顺利,直到这一步:
现在更改您的民意调查/ index.html模板:
<li><a href="{% url 'detail' poll.id %}">{{ poll.question }}</a></li>
Run Code Online (Sandbox Code Playgroud)
指向命名空间详细信息视图:
<li><a href="{% url 'polls:detail' poll.id %}">{{ poll.question }}</a></li>
Run Code Online (Sandbox Code Playgroud)
你可以看到整段[HERE] [2].
这就是我将'细节'改为'民意调查:细节'之后发生的事情:
NoReverseMatch at /polls/
'polls' is not a registered namespace
Request Method: GET
Request URL: http://127.0.0.1:8000/polls/
Django Version: 1.6.4
Exception Type: NoReverseMatch
Exception Value:
'polls' is not a registered namespace
Exception Location: D:\Programy\Python 3.4\lib\site-packages\django\core\urlresolvers.py in reverse, line 528
Python Executable: D:\Programy\Python 3.4\python.exe
Python Version: 3.4.0
Python Path:
['D:\\dziango\\strona1',
'D:\\Programy\\Python 3.4\\python34.zip',
'D:\\Programy\\Python 3.4\\DLLs',
'D:\\Programy\\Python 3.4\\lib',
'D:\\Programy\\Python 3.4',
'D:\\Programy\\Python …Run Code Online (Sandbox Code Playgroud)