Opened 7 years ago

Closed 6 years ago

#17537 closed Uncategorized (worksforme)

Writing your first Django app, part 4 - Generic Views - Update to index.html needed

Reported by: canice_lambe@… Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I could only get the Generic Views to work after I gave the detail view a name 'poll_details' in the urlpatterns and updated index.html to have line:

<li><a href="{% url poll_details %}">{{ }}. {{ poll.question }}</a></li>

Change History (1)

comment:1 Changed 6 years ago by Nate Bragg

Resolution: worksforme
Status: newclosed

I just built up this tutorial, and it runs just fine leaving the link in index.html as so:

 <a href="/polls/{{ }}/">{{ poll.question }}</a> 

As the url reversal template tag isn't even introduced in the "first Django app" tut, I think it may be better to leave as is. The extra step you took is, as they say, an exercise for the reader.

Note: See TracTickets for help on using tickets.
Back to Top