'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:

  • User is redirected to a "Sign in With Google" page. Google will return the following fields: the user's name, Google ID and email.
  • Then, I want to prompt the user to a "Finish registering Account" page. In this page, the user will have to fill out input fields for their Username, Year Group and Favourite Subject

  • I cannot find any solutions for this specific case.

    My Questions

  • How do I create a custom Social Accounts Model in Django-AllAuth?
  • How do I ask users to fill out another Finishing Registering Form?

  • 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