Skip to main content

Django all auth includes all account, including django default, OAuth (Google, Discord, Twitch), openId (Steam).

Project description

Django all auth includes all account, including django default, OAuth (Google, Discord, Twitch), openId (Steam).

Detailed documentation is in the “docs” directory.

Demo Images:

Login/Signup Page

https://raw.githubusercontent.com/deviserops/dj-all-auth/refs/heads/master/docs/images/login.png

Quick start

  1. Install it by:

    https://pypi.org/project/dj-all-auth/
    
    pip install dj-all-auth
  2. Add “dj_all_auth” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...,
        'dj_all_auth',
    ]
  3. Include the polls URLconf in your project urls.py like this:

    # if you are not using /accounts url then you need to add `LOGIN_URL = '<your-url>'` in your settings.py, and use that url to url path.
    
    path('accounts/', include('dj_all_auth.urls')),
  4. Add context processor to settings.py:

    'dj_all_auth.context_processors.__config'
  5. Add dj_all_auth settings to settings.py:

    DJ_ALL_AUTH = {
        # static path of logo image
        'LOGO': None,
        'CSS': {},
        'JS': {},
        'CONNECTIONS': {
            # name of the url that will be used once OAuth is completed
            'REDIRECT_URI_NAME': None,
            'GOOGLE': {
                # Set {domain-with-above-url-without-locale (en/gb)}/accounts/google/authenticated to google redirect url in google developer console
                'CLIENT_ID': os.getenv('GOOGLE_CLIENT_ID') if os.getenv('GOOGLE_CLIENT_ID') else None,
                'CLIENT_SECRET': os.getenv('GOOGLE_CLIENT_SECRET') if os.getenv('GOOGLE_CLIENT_SECRET') else None,
                'SCOPE': ['openid', 'email', 'https://www.googleapis.com/auth/drive.file']
            },
            'TWITCH': {
                # Set {domain-with-above-url-without-locale (en/gb)}/account/twitch/authenticated to twitch redirect url in twitch developer console
                'CLIENT_ID': os.getenv('TWITCH_CLIENT_ID') if os.getenv('TWITCH_CLIENT_ID') else None,
                'CLIENT_SECRET': os.getenv('TWITCH_CLIENT_SECRET') if os.getenv('TWITCH_CLIENT_SECRET') else None,
                'SCOPE': ['openid', 'user:read:email', 'user:read:broadcast']
            },
            'DISCORD': {
                # Set {domain-with-above-url-without-locale (en/gb)}/account/discord/authenticated to discord redirect url in discord developer console
                'CLIENT_ID': os.getenv('DISCORD_CLIENT_ID') if os.getenv('DISCORD_CLIENT_ID') else None,
                'CLIENT_SECRET': os.getenv('DISCORD_CLIENT_SECRET') if os.getenv('DISCORD_CLIENT_SECRET') else None,
                'SCOPE': ['identify', 'email', 'connections', 'guilds', 'guilds.join']
            }
        }
    }
  6. To create migrations run:

    python manage.py migrate
  7. If you are using multilanguage then to create language file run:

    python manage.py makemessages --all -i venv
  8. Visit the /accounts/ URL to access user account.

  9. To create multilanguage url you need to have locale/<language-code> directory, then run:

    python manage.py makemessages --all -i venv
    # then make your changes in your local file then run
    python manage.py compilemessages

Notes:

These are additional packages used for UI stability - You can find them on my profile.


Test, Build and upload.

  • python -m build

  • pip install –user django-all-auth/dist/path_to.tar.gz To run on local

  • twine upload dist/* –verbose

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj_all_auth-0.1b17.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dj_all_auth-0.1b17-py3-none-any.whl (485.3 kB view details)

Uploaded Python 3

File details

Details for the file dj_all_auth-0.1b17.tar.gz.

File metadata

  • Download URL: dj_all_auth-0.1b17.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for dj_all_auth-0.1b17.tar.gz
Algorithm Hash digest
SHA256 48ad1e63df74854fc3e87820e3d90ec1bfaabb6cd6e468d685f13c8915b06636
MD5 eb7ca8ff3ce7f0290545e79b96f0fd11
BLAKE2b-256 dcaece94d5f475d9d6647f41e5da995cd4390d3d4edf3b5137212f0c25b94d3b

See more details on using hashes here.

File details

Details for the file dj_all_auth-0.1b17-py3-none-any.whl.

File metadata

  • Download URL: dj_all_auth-0.1b17-py3-none-any.whl
  • Upload date:
  • Size: 485.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for dj_all_auth-0.1b17-py3-none-any.whl
Algorithm Hash digest
SHA256 abe51b5f0af1cf5e06e853e21c438c56a180e16041f1ca84077107a40b1c855e
MD5 a87914c7313d2312f85022969e837a10
BLAKE2b-256 843769e6af9a0ad8d336c46e75f0c1ed287dba751e1b9b72e3b5958b0d581eb7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page