The one-step workflow¶
As an alternative to the two-step (registration and activation) workflow, django-registration bundles a one-step registration workflow in django_registration.backends.one_step. This workflow consists of as few steps as possible:
- A user signs up by filling out a registration form.
- The user’s account is created and is active immediately, with no intermediate confirmation or activation step.
- The new user is logged in immediately.
To use this workflow, include the URLconf django_registration.backends.one_step.urls somewhere in your site’s own URL configuration. For example:
from django.urls import include, path urlpatterns = [ # Other URL patterns ... path('accounts/', include('django_registration.backends.one_step.urls')), path('accounts/', include('django.contrib.auth.urls')), # More URL patterns ... ]
To control whether registration of new accounts is allowed, you can
specify the setting
Upon successful registration, the user will be redirected to the
site’s home page – the URL /. This can be changed by subclassing
and overriding the method
or setting the attribute
can also do this in a URLconf. For example:
from django.conf.urls import include, url from django_registration.backends.one_step.views import RegistrationView urlpatterns = [ # Other URL patterns ... path('accounts/register/', RegistrationView.as_view(success_url='/profile/'), name='django_registration_register'), path('accounts/', include('django_registration.backends.one_step.urls')), path('accounts/', include('django.contrib.auth.urls')), # More URL patterns ... ]
The default form class used for account registration will be
django_registration.forms.RegistrationForm, although this can
be overridden by supplying a custom URL pattern for the registration
view and passing the keyword argument form_class, or by subclassing
and either overriding
and specifying the custom subclass in your URL patterns.