Authentication

This viewset allows for quick integration of all standard Django authentication views into the URL configuration. It provides customization options for password change, profile view, and integration with Django-allauth if required. By using this viewset, developers can easily set up authentication-related routes, including login, logout, password change, password reset, and profile management, with minimal configuration effort.

class viewflow.contrib.auth.AuthViewset(*, allow_password_change=True, with_profile_view=True, **kwargs)

Class-based URL configuration for django.contrib.auth.

This viewset provides URL patterns for user authentication, including login, logout, and password management views.

urlpatterns = [
    path('accounts/', AuthViewset(
        allow_password_change=False,
        login_view=views.LoginView.as_view(
            authentication_form=MyAuthForm
        ),
    ).urls),
]
__init__(*, allow_password_change=True, with_profile_view=True, **kwargs)

Initialize the viewset with options for password change and profile view.

Parameters
  • allow_password_change – Enable or disable password change/reset views. Defaults to True.
  • with_profile_view – Enable or disable profile view. Defaults to True.
get_login_view_kwargs(**kwargs)

Get keyword arguments for the login view.

Parameters
kwargs – Additional keyword arguments for the login view.
Returns
Dictionary of keyword arguments.
get_logout_view_kwargs(**kwargs)

Get keyword arguments for the logout view.

Parameters
kwargs – Additional keyword arguments for the logout view.
Returns
Dictionary of keyword arguments.
get_pass_change_done_view_kwargs(**kwargs)

Get keyword arguments for the password change done view.

Parameters
kwargs – Additional keyword arguments for the password change done view.
Returns
Dictionary of keyword arguments.
get_pass_change_view_kwargs(**kwargs)

Get keyword arguments for the password change view.

Parameters
kwargs – Additional keyword arguments for the password change view.
Returns
Dictionary of keyword arguments.
get_pass_reset_complete_view_kwargs(**kwargs)

Get keyword arguments for the password reset complete view.

Parameters
kwargs – Additional keyword arguments for the password reset complete view.
Returns
Dictionary of keyword arguments.
get_pass_reset_confirm_view_kwargs(**kwargs)

Get keyword arguments for the password reset confirm view.

Parameters
kwargs – Additional keyword arguments for the password reset confirm view.
Returns
Dictionary of keyword arguments.
get_pass_reset_done_view_kwargs(**kwargs)

Get keyword arguments for the password reset request done view.

Parameters
kwargs – Additional keyword arguments for the password reset request done view.
Returns
Dictionary of keyword arguments.
get_pass_reset_view_kwargs(**kwargs)

Get keyword arguments for the password reset request view.

Parameters
kwargs – Additional keyword arguments for the password reset request view.
Returns
Dictionary of keyword arguments.
get_profile_view_kwargs(**kwargs)

Get keyword arguments for the profile view.

Parameters
kwargs – Additional keyword arguments for the profile view.
Returns
Dictionary of keyword arguments.
property login_path

Property to get the URL pattern for the login view.

Returns
URL pattern for the login view.
login_view

Property to get the configured login view.

Returns
Configured login view instance.
login_view_class

alias of LoginView

property logout_path

Property to get the URL pattern for the logout view.

Returns
URL pattern for the logout view.
logout_view

Property to get the configured logout view.

Returns
Configured logout view class.
logout_view_class

alias of LogoutView

property pass_change_done_path

Property to get the URL pattern for the password change done view.

Returns
URL pattern for the password change done view.
pass_change_done_view

Property to get the configured password change done view.

Returns
Configured password change done view class.
pass_change_done_view_class

alias of PasswordChangeDoneView

property pass_change_path

Property to get the URL pattern for the password change view.

Returns
URL pattern for the password change view.
pass_change_view

Property to get the configured password change view.

Returns
Configured password change view class.
pass_change_view_class

alias of PasswordChangeView

property pass_reset_complete_path

Property to get the URL pattern for the password reset complete view.

Returns
URL pattern for the password reset complete view.
pass_reset_complete_view

Property to get the configured password reset complete view.

Returns
Configured password reset complete view class.
pass_reset_complete_view_class

alias of PasswordResetCompleteView

property pass_reset_confirm_path

Property to get the URL pattern for the password reset confirm view.

Returns
URL pattern for the password reset confirm view.
pass_reset_confirm_view

Property to get the configured password reset confirm view.

Returns
Configured password reset confirm view class.
pass_reset_confirm_view_class

alias of PasswordResetConfirmView

property pass_reset_done_path

Property to get the URL pattern for the password reset request done view.

Returns
URL pattern for the password reset request done view.
pass_reset_done_view

Property to get the configured password reset request done view.

Returns
Configured password reset request done view class.
pass_reset_done_view_class

alias of PasswordResetDoneView

property pass_reset_path

Property to get the URL pattern for the password reset request view.

Returns
URL pattern for the password reset request view.
pass_reset_view

Property to get the configured password reset request view.

Returns
Configured password reset request view class.
pass_reset_view_class

alias of PasswordResetView

property profile_path

Property to get the URL pattern for the profile view.

Returns
URL pattern for the profile view.
profile_view

Property to get the configured profile view.

Returns
Configured profile view class.
profile_view_class

alias of ProfileView