'How do I create a custom Django AllAuth Socialaccount model?
Here is a summary of app I am attempting to create:
I want users (who are primarily students) to register in my app using their Google Accounts. The service I am using to manage this creation of accounts is Django-AllAuth. Django-AllAuth has a very limited Social Account Model (it only saves username, email, name and their roles).
I want to have further fields that I save in my DB. I want to save my users' Year Group and Favourite Subject.
How a user registers on my website:
I cannot find any solutions for this specific case.
My Questions
I am aware that you can redirect users to a Finishing Registering Form via this code in the settings.py file. However, this form only consists of the "email" and "username" fields.
SOCIALACCOUNT_AUTO_SIGNUP=False
Here is my AllAuth Configuration (in settings.py):
SOCIALACCOUNT_AUTO_SIGNUP=False
SOCIALACCOUNT_LOGIN_ON_GET=False
SOCIALACCOUNT_EMAIL_REQUIRED=True
ACCOUNT_USERNAME_REQUIRED=True
ACCOUNT_UNIQUE_EMAIL=True
SOCIALACCOUNT_PROVIDERS = {
'google': {
'SCOPE': [
'profile',
'email',
],
'AUTH_PARAMS': {
'access_type': 'offline',
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
