November 2015
Beginner to intermediate
840 pages
26h 30m
English
In Chapter 5 we built a view to redirect our root URL to our blog post list. This view, thanks to GCBVs, is completely unnecessary. We therefore replace the view and the URL pattern with the RedirectView GCBV.
To start, delete the suorganizer/views.py file. In suorganizer/urls.py, replace the URL pattern referencing redirect_root with the code in Example 17.31.
Example 17.31: Project Code
suorganizer/urls.py in b02e39dac0
20 from django.views.generic import RedirectView . ... 29 url(r'^$', 30 RedirectView.as_view( 31 pattern_name='blog_post_list', 32 permanent=False)),
Thanks to the ability to override CBV attributes and the behavior ...
Read now
Unlock full access