Dashboard Authentication - Login View
Django Account Authentication Login view.
- class smarter.apps.account.views.authentication.login_view.LoginView(*args, **kwargs)[source]
Bases:
SmarterNeverCachedWebViewView 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:
FormForm for the sign-in page.
Form fields:
email: Email (EmailField)password: Password (CharField)
- property media
Return all media required to render the widgets on this form.
- __init__(*args, **kwargs)[source]
Initialize the SmarterView with request and other arguments. This method initializes the SmarterRequestMixin with the request.
- Parameters:
args – Positional arguments, where the first argument is expected to be the HttpRequest.
kwargs – Keyword arguments, which may include the HttpRequest under the ‘request’ key.
- Returns:
None
- Return type:
None
- property formatted_class_name
Returns the class name in a formatted string along with the name of this mixin.
- Returns:
Formatted class name string.
- 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:
- 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: