November 2015
Beginner to intermediate
840 pages
26h 30m
English
If we pop open Django’s source code, we can browse to django/contrib/auth/views.py and look at the definition of login(), shown in Example 19.30.
Example 19.30: Python Code
# django/contrib/auth/views.py def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME, authentication_form=AuthenticationForm, current_app=None, extra_context=None):
The parameter we’re interested in overriding is template_name.
To start, we should import all of the tools we will need for our URL patterns, as shown in Example 19.31.
Example 19.31: Project Code
Read now
Unlock full access