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. Add “dj_all_auth” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...,
        'dj_all_auth',
    ]
  2. 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')),
  3. Add context processor to settings.py:

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

    DJ_ALL_AUTH = {
        # static path of logo image
        'LOGO': None,
        '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']
            }
        }
    }
  1. To create migrations run:

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

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

  4. 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.1b9.tar.gz (398.2 kB view details)

Uploaded Source

Built Distribution

dj_all_auth-0.1b9-py3-none-any.whl (415.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dj_all_auth-0.1b9.tar.gz
  • Upload date:
  • Size: 398.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for dj_all_auth-0.1b9.tar.gz
Algorithm Hash digest
SHA256 c56751ea0c7b873cfed5c7cb51559a4fc335a676d984512603319ff3906a735a
MD5 5247a84188481173fcbc198e4fa63b3a
BLAKE2b-256 1d7a94b0ae0a7f4c438b0fce65e0edb86e5546b638a04fed8378855319c0e284

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dj_all_auth-0.1b9-py3-none-any.whl
  • Upload date:
  • Size: 415.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for dj_all_auth-0.1b9-py3-none-any.whl
Algorithm Hash digest
SHA256 f94513ee73ee8c305edbb87b3f1d499ad98d946b400e0f67f49b2843c6aa50e2
MD5 b6fef19e6b4ef1cddf9286642bfc76aa
BLAKE2b-256 52070c4bde5d784250ba7c2f3a9840ab5c0e3e66f9ca6098d31bc25ccce30888

See more details on using hashes here.

Supported by

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