allauth.account.forms.LoginForm
account_login view.
Example override:
from allauth.account.forms import LoginForm class MyCustomLoginForm(LoginForm): def login(self, *args, **kwargs): # Add your own processing here. # You must return the original result. return super(MyCustomLoginForm, self).login(*args, **kwargs)
You have access to the following:
self.user
is the User object that is logging in.
settings.py
:
ACCOUNT_FORMS = {'login': 'mysite.forms.MyCustomLoginForm'}Signup
allauth.account.forms.SignupForm
account_signup view.
Example override:
from allauth.account.forms import SignupForm class MyCustomSignupForm(SignupForm): def save(self, request): # Ensure you call the parent class's save. # .save() returns a User object. user = super(MyCustomSignupForm, self).save(request) # Add your own processing here. # You must return the original result. return user
settings.py
:
ACCOUNT_FORMS = {'signup': 'mysite.forms.MyCustomSignupForm'}Add Email
allauth.account.forms.AddEmailForm
account_email view.
Example override:
from allauth.account.forms import AddEmailForm class MyCustomAddEmailForm(AddEmailForm): def save(self, request): # Ensure you call the parent class's save. # .save() returns an allauth.account.models.EmailAddress object. email_address_obj = super(MyCustomAddEmailForm, self).save(request) # Add your own processing here. # You must return the original result. return email_address_obj
You have access to the following:
self.user
is the User object that is logged in.
settings.py
:
ACCOUNT_FORMS = {'add_email': 'mysite.forms.MyCustomAddEmailForm'}Change Password
allauth.account.forms.ChangePasswordForm
account_change_password view.
Example override:
from allauth.account.forms import ChangePasswordForm class MyCustomChangePasswordForm(ChangePasswordForm): def save(self): # Ensure you call the parent class's save. # .save() does not return anything super(MyCustomChangePasswordForm, self).save() # Add your own processing here.
You have access to the following:
self.user
is the User object that is logged in.
settings.py
:
ACCOUNT_FORMS = {'change_password': 'mysite.forms.MyCustomChangePasswordForm'}Set Password
allauth.account.forms.SetPasswordForm
account_set_password view.
Example override:
from allauth.account.forms import SetPasswordForm class MyCustomSetPasswordForm(SetPasswordForm): def save(self): # Ensure you call the parent class's save. # .save() does not return anything super(MyCustomSetPasswordForm, self).save() # Add your own processing here.
You have access to the following:
self.user
is the User object that is logged in.
settings.py
:
ACCOUNT_FORMS = {'set_password': 'mysite.forms.MyCustomSetPasswordForm'}Reset Password
allauth.account.forms.ResetPasswordForm
account_reset_password view.
Example override:
from allauth.account.forms import ResetPasswordForm class MyCustomResetPasswordForm(ResetPasswordForm): def save(self, request): # Ensure you call the parent class's save. # .save() returns a string containing the email address supplied email_address = super(MyCustomResetPasswordForm, self).save(request) # Add your own processing here. # Ensure you return the original result return email_address
You have access to the following:
self.users
is a list of all possible User objects with matching email address.
settings.py
:
ACCOUNT_FORMS = {'reset_password': 'mysite.forms.MyCustomResetPasswordForm'}Reset Password From Key
allauth.account.forms.ResetPasswordKeyForm
account_reset_password view.
Example override:
from allauth.account.forms import ResetPasswordKeyForm class MyCustomResetPasswordKeyForm(ResetPasswordKeyForm): def save(self): # Add your own processing here. # Ensure you call the parent class's save. # .save() does not return anything super(MyCustomResetPasswordKeyForm, self).save()
You have access to the following:
self.user
is the User object.
settings.py
:
ACCOUNT_FORMS = {'reset_password_from_key': 'mysite.forms.MyCustomResetPasswordKeyForm'}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4