#16561: incorrect url in template
----------------------------+-------------------------------
Reporter: tim.proffitt@… | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Documentation
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 1
UI/UX: 0 |
----------------------------+-------------------------------
in part 3 you have us noobs write the index template:
{% if latest_poll_list %}
<ul>
{% for poll in latest_poll_list %}
<li><a '''href="/polls/'''{{ poll.id }}/">{{ poll.question
}}</a></li>
{% endfor %}
</ul>
...
then we go and decouple URLconfs which includes this line:
urlpatterns = patterns('polls.views',
...
and then (and I didn't notice this until the end) when we go to
mysite/polls/ and see the list of polls generated from the template and
view the source the links look like so:
<a href="polls/1/"> ... </a>
the polls prefix is redundant with the changes we made to urlconfs. when
you click on one of the links you will be redirected to a 404 referencing
the failure to find polls/polls/n.
this issue remains even later when we use the generic templates and
completely rewrite urlconfs.
--
Ticket URL: <https://code.djangoproject.com/ticket/16561>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.