November 2015
Beginner to intermediate
840 pages
26h 30m
English
With a form to work with, we can move straight into building a view and a URL pattern to interact with the form. We anticipate building a class-based view (CBV) called ContactView and therefore create a new file /contact/urls.py to house our URL configuration, as shown in Example 11.9.
Example 11.9: Project Code
1 from django.conf.urls import url 2 from .views import ContactView 3 4 5 urlpatterns = [ 6 url(r'^$', 7 ContactView.as_view(), 8 name='contact'), 9 ]
We need to point our root URL configuration to this new file, as shown in Example 11.10.
Example 11.10: Project Code
Read now
Unlock full access