November 2015
Beginner to intermediate
840 pages
26h 30m
English
homepage() ViewBefore we build out new views, it is in our best interest to change our homepage() view to give it a more sensible name and URL path.
Given that it is a list of Tag objects, we should replace the URL pattern so that it matches tag/ as the URL path and provide it with a name, organizer_tag_list, as demonstrated in Example 5.41 in /organizer/urls.py.
Example 5.41: Project Code
organizer/urls.py in 1f86398a5e
1 from django.conf.urls import url 2 3 from .views import tag_detail, tag_list 4 5 urlpatterns = [ 6 url(r'^tag/$', 7 tag_list, 8 name='organizer_tag_list'), 9 url(r'^tag/(?P<slug>[\w\-]+)/$', 10 tag_detail, 11 name ...
Read now
Unlock full access