class AccessMixin
-
login_url -
Default return value for
get_login_url(). Defaults toNonein which caseget_login_url()falls back tosettings.LOGIN_URL.
-
permission_denied_message -
Default return value for
get_permission_denied_message(). Defaults to an empty string.
-
redirect_field_name -
Default return value for
get_redirect_field_name(). Defaults to"next".
-
raise_exception -
If this attribute is set to
True, aPermissionDeniedexception will be raised instead of the redirect. Defaults toFalse.
-
get_login_url() -
Returns the URL that users who don’t pass the test will be redirected to. Returns
login_urlif set, orsettings.LOGIN_URLotherwise.
-
get_permission_denied_message() -
When
raise_exceptionisTrue, this method can be used to control the error message passed to the error handler for display to the user. Returns thepermission_denied_messageattribute by default.
-
get_redirect_field_name() -
Returns the name of the query parameter that will contain the URL the user should be redirected to after a successful login. If you set this to
None, a query parameter won’t be added. Returns theredirect_field_nameattribute by default.
-
handle_no_permission() -
Depending on the value of
raise_exception, the method either raises aPermissionDeniedexception or redirects the user to thelogin_url, optionally including theredirect_field_nameif it is set.
Please login to continue.