August 2016
Beginner to intermediate
717 pages
15h 24m
English
When developers implement an authentication system, it's usually to limit access to anonymous users. In this section, we'll see two ways to control access to our web pages.
The authentication module provides simple ways to prevent anonymous users from accessing some pages. Indeed, there is a very convenient decorator to restrict access to a view. This decorator is called login_required.
In the example that follows, we will use the designer to limit access to the page() view from the create_developer module in the following manner:
from django.contrib.auth.decorators import login_required
Read now
Unlock full access