Wednesday, November 2, 2011

tutorial error

It says at the end of part 3 of the Django tutorial:

"The idea behind include() and URLconf decoupling is to make it easy
to plug-and-play URLs. Now that polls are in their own URLconf, they
can be placed under "/polls/", or under "/fun_polls/", or under "/
content/polls/", or any other path root, and the app will still work."

It's actually not that simple. Simply changing the project-wide
URLconf prefix from '^polls/' to '^fun_polls/' will not work, because
the code referencing templates still has polls in its path:
render_to_response('polls/detail.html', {'poll': p})
or in URLs:
<a href="/polls/{{ poll.id }}/">{{ poll.question }}</a>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment