djmvc_auth

class djmvc_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

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

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 djmvc_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 djmvc_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 djmvc_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 djmvc_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.

djmvc_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.

djmvc_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 djmvc_auth.views.GroupController[source]

Bases: ModelController

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

get_queryset(view)[source]

Return all rows for view; override to scope per user or role.

class djmvc_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 djmvc_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 djmvc_auth.views.AuthController[source]

Bases: Controller