Authentication views

Django provides several views that you can use for handling login, logout, and password management. These make use of the built-in auth forms but you can pass in your own forms as well. Django provides no default template for the authentication views-however, the following template context is documented for each view.

There are different methods to implement these views in your project, however, the easiest and most common way is to include the provided URLconf in Django.contrib.auth.urls in your own URLconf, for example:

urlpatterns = [url('^', include('Django.contrib.auth.urls'))] 

This will make each of the views available at a default URL (detailed in next section).

The built-in views all return a TemplateResponse instance, ...

Get Mastering Django: Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.