djcrud_auth

class djcrud_auth.views.LoginView(**kwargs)[source]

Bases: FormView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

form_class

alias of AuthenticationForm

property form_attributes

HTML attributes for the login form; targets the full page body.

property title

Human-readable label with the View suffix removed.

has_permission()[source]

Show login only to anonymous users.

get_form_valid_message()[source]

Success toast message after valid submit.

form_valid(form)[source]

Show success message and delegate to Django’s form_valid.

class djcrud_auth.views.LogoutView(**kwargs)[source]

Bases: FormView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

property title

Human-readable label with the View suffix removed.

has_permission()[source]

Show logout only to authenticated users.

get_form_valid_message()[source]

Success toast message after valid submit.

form_valid(form)[source]

Show success message and delegate to Django’s form_valid.

class djcrud_auth.views.PasswordView(**kwargs)[source]

Bases: ObjectMixin, ModelMixin, FormMixin, TemplateViewMixin, FormView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

property codename

URL segment with the model name removed from the default codename.

property title

Human-readable label with the model class name removed.

property submit_button_label

Primary submit button text; defaults to title.

get_form_class()[source]

Return form_class or Django’s base Form.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_success_url()[source]

Redirect target after successful submit (next POST field or /).

form_valid(form)[source]

Show success message and delegate to Django’s form_valid.

class djcrud_auth.views.BecomeUser(**kwargs)[source]

Bases: ObjectMixin, ModelMixin, View

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

property codename

URL segment with the model name removed from the default codename.

property title

Human-readable label with the model class name removed.

unpoly_attributes(context=None)[source]

HTML attributes for Unpoly navigation on this view.

class djcrud_auth.views.Become(**kwargs)[source]

Bases: View

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

property codename

URL segment with the view suffix removed from the class name.

has_permission()[source]

Return whether the current user may access this view.

property title

Human-readable label with the View suffix removed.

unpoly_attributes(context=None)[source]

HTML attributes for Unpoly navigation on this view.

dispatch(*args, **kwargs)[source]

Redirect anonymous users to login; return 403 when permission denied.

djcrud_auth.views.get_custom_user_creation_form()[source]

Return UserCreationForm for the configured AUTH_USER_MODEL.

Django’s default forms are hardcoded to auth.User, so we create a new form class with type() that uses settings.AUTH_USER_MODEL instead.

djcrud_auth.views.get_custom_user_change_form()[source]

Return UserChangeForm for the configured AUTH_USER_MODEL.

Django’s default forms are hardcoded to auth.User, so we create a new form class with type() that uses settings.AUTH_USER_MODEL instead.

class djcrud_auth.views.GroupRouter[source]

Bases: ModelRouter

CRUD for auth groups; autocomplete endpoint used by User form filters.

get_queryset(*, user, model, action, perm, obj=None)[source]

Return rows visible to user via the permission registry, then all rows.

class djcrud_auth.views.UserCreateView(**kwargs)[source]

Bases: CreateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get_form_class()[source]

Return form_class or a factory from fields.

class djcrud_auth.views.UserUpdateView(**kwargs)[source]

Bases: UpdateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

get_form_class()[source]

Return form_class or a factory from fields.

class djcrud_auth.views.UserRouter[source]

Bases: ModelRouter

class djcrud_auth.views.AuthRouter[source]

Bases: Router