O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

21.6.3 Views for Creating and Activating Accounts

Now that we have our UserCreationForm, we can build the views to create and activate new users. To begin, we can create the CreateAccount view, starting in the user/urls.py file. We first import the necessary tools and views, as shown in Example 21.59.

Example 21.59: Project Code

user/urls.py in 9af8a05373

 7   from django.views.generic import (  8       RedirectView, TemplateView)  9 10   from .views import ( 11       ActivateAccount, CreateAccount, 12       DisableAccount)

We can then create a very simple URL pattern for CreateAccount, as shown in Example 21.60.

Example 21.60: Project Code

user/urls.py in 9af8a05373

73     url(

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required