Hi
-- It looks like you have in polls/views.py whitespace in reverse function ("polls: results"), try without it ('polls:results").
On Sunday, June 22, 2014 10:53:12 AM UTC+2, Jerry Wu wrote:
On Sunday, June 22, 2014 10:53:12 AM UTC+2, Jerry Wu wrote:
Dear every one,I am new to Python and Django and am following the Tutorial to start my first site. But I am getting an error of NoReverseMatch error when vote. It should be redirected but error below happened.NoReverseMatch at /polls/1/vote/
Reverse for ' results' with arguments '(1,)' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Request Method: POST Request URL: http://localhost:8000/polls/1/ vote/ Django Version: 1.6.5 Exception Type: NoReverseMatch Exception Value: Reverse for ' results' with arguments '(1,)' and keyword arguments '{}' not found. 0 pattern(s) tried: []Exception Location: /Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/site-packages/ django/core/urlresolvers.py in _reverse_with_prefix, line 452 Python Executable: /Library/Frameworks/Python. framework/Versions/2.7/ Resources/Python.app/Contents/ MacOS/Python Python Version: 2.7.6 Python Path: ['/Users/wctjerry/Dropbox/code/django/mysite', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python27.zip', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/plat-darwin', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/plat-mac', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/plat-mac/lib- scriptpackages', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/lib-tk', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/lib-old', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/lib-dynload', '/Library/Frameworks/Python. framework/Versions/2.7/lib/ python2.7/site-packages', '/Library/Python/2.7/site- packages'] Server time: Sun, 22 Jun 2014 08:38:56 +0000 I am sure I finished namespace part in the end of Tutorial Part 3. And I checked code in Tutorial Part 4 again and again, seeming all the same. Here is my code, could any one give me some thoughts?Thanks.mysite/urls: http://pastebin.com/8armrsXC polls/urls: http://pastebin.com/Tn1uFXi4 polls/views: http://pastebin.com/jhnnidQr index.html: http://pastebin.com/S1XhmsBb detail.html: http://pastebin.com/GTsV3D7D results.html: http://pastebin.com/BtSf5teF
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/90503181-35b6-4cca-ac2b-5cd54b006435%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment