November 2015
Beginner to intermediate
840 pages
26h 30m
English
The first and perhaps most obvious way would be to create a new URL pattern to send the route to the view we have already built. In /suorganizer/urls.py, we could add the URL pattern shown in Example 5.73 to the URL configuration.
Example 5.73: Project Code
suorganizer/urls.py in 3ddb5f3810
20 from blog.views import PostList . ... 23 urlpatterns = [ 24 url(r'^$', 25 PostList.as_view()), . ... 29 ]
The regular expression pattern: ^ starts the pattern, while $ ends the pattern. This matches '', which is what the root of the URL is to Django, given that it always strips the first /.
Similarly, given that the PostList view is the root ...
Read now
Unlock full access