Dashboard Authentication - Login View

Django Account Authentication Login view.

class smarter.apps.account.views.authentication.login_view.LoginView(*args, **kwargs)[source]

Bases: SmarterNeverCachedWebView

View for logging in browser session.

class LoginForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]

Bases: Form

Form for the sign-in page.

Form fields:

property media

Return all media required to render the widgets on this form.

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

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

property formatted_class_name

Returns the class name in a formatted string along with the name of this view.

get(request, *args, **kwargs)[source]

Handle GET requests and return a cleaned HttpResponse.

Parameters:

request (HttpRequest) – The HTTP request object.

Returns:

An HttpResponse with the cleaned HTML content.

Return type:

Union[HttpResponseRedirect, HttpResponse]

property is_github_oauth_enabled: bool

Check if GitHub OAuth is enabled.

If True, the sign-in page will show the GitHub OAuth sign-in option. To return True, both the key and secret must be set in settings, and the appropriate authentication backend must be included in Django settings.AUTHENTICATION_BACKENDS.

See: https://docs.djangoproject.com/en/6.0/topics/auth/customizing/

Returns:

True if GitHub OAuth is enabled, False otherwise.

Return type:

bool

property is_google_oauth_enabled: bool

Check if Google OAuth is enabled.

If True, the sign-in page will show the Google OAuth sign-in option. To return True, both the key and secret must be set in settings, and the appropriate authentication backend must be included in Django settings.AUTHENTICATION_BACKENDS.

See: https://docs.djangoproject.com/en/6.0/topics/auth/customizing/

Returns:

True if Google OAuth is enabled, False otherwise.

Return type:

bool

post(request, *args, **kwargs)[source]

Handle POST request to log in user with email and password.

Return type:

Union[HttpResponseRedirect, SmarterHttpResponseBadRequest, SmarterHttpResponseForbidden, SmarterHttpResponseServerError]

template_path: str = 'account/authentication/sign-in.html'