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.

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('connection/', include('dj_all_auth.urls')),
  4. Add dj_all_auth settings to settings.py:

    DJ_ALL_AUTH = {
        '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)}/connection/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)}/connection/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)}/connection/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']
            }
        }
    }
  1. To create migrations run:

    python manage.py migrate
  1. Now you can simply hit the login url and All Done, you will be logged in using appropriate requested connection.:

    For ex: `connection/google/authenticate` and you will be redirect to login page for google.

Test, Build and upload.:

  • python -m build

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

  • ============================

  • First Test Upload

  • python3 -m twine upload –repository testpypi dist/*

  • ============================

  • Then Live Upload

  • 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.1b19.tar.gz (1.6 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.1b19-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dj_all_auth-0.1b19.tar.gz
Algorithm Hash digest
SHA256 7cae4b88676483ba6c51a561bcd8862d2a975a9633f9ee6ace571537cb862990
MD5 af9bbfbd564da6189e477668bd812804
BLAKE2b-256 06630704d2f7675882385d5fc0e5555a3e130464acb751f650c4d7dacc0b49fd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dj_all_auth-0.1b19-py3-none-any.whl
Algorithm Hash digest
SHA256 a715738f8f85373c166877aed6ba3a967b29f7195614f77786ced1607f0670c4
MD5 04bf2cc53216ae0700d1e77f365b54de
BLAKE2b-256 84529a11c741c5dda250e02cac4ae3ba9ae36264d15427517dadf15aa2355f4a

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