djblets.auth.views¶
Authentication-related views.
The bundled views help with common authentication-related tasks not otherwise provided by Django. At the moment, there is only support here for registration.
- register(request, next_page, form_class=<class 'djblets.auth.forms.RegistrationForm'>, extra_context=None, initial_values=None, form_kwargs=None, template_name='accounts/register.html')[source]¶
Handle registration of a new user.
This works along with
djblets.auth.forms.RegistrationForm
to register a new user. It will display a registration form, validate the user’s new information, and then log them in.The registration form, next page, and context can all be customized by the caller.
- Parameters:
request (
HttpRequest
) – The HTTP request from the client.next_page (
unicode
) – The URL to navigate to once registration is successful.form_class (
Form
subclass
) – The form that will handle registration, field validation, and creation of the user.extra_context (
dict
) – Extra context variables to pass to the template when rendering.initial_values (
dict
) – Initial values to set on the form when it is rendered.form_kwargs (
dict
) – Additional keyword arguments to pass to the form class during instantiation.template_name (
unicode
) – The name of the template containing the registration form.
- Returns:
The page’s rendered response or redirect.
- Return type:
HttpResponse