Skip to main content

Django application for secure user authorisation using Discord OAuth2

Project description

django-discord-oauth2

[!WARNING] App under development!!

Installation

pip install django-discord-oauth2

Usage

  1. Add django_discord_oauth2 to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        'django_discord_oauth2',
    ]
    
  2. Include the django_discord_oauth2 URLconf in your project urls.py like this:

    from django.urls import include, path
    
    urlpatterns = [
        path('oauth2/', include('django_discord_oauth2.urls')),
    ]
    
  3. Run python manage.py migrate to create the necessary models.

  4. Add your Discord application credentials to your settings:

    DISCORD_CLIENT_ID = 'your_client_id'
    DISCORD_CLIENT_SECRET = 'your_client_secret'
    DISCORD_REDIRECT_URI = 'your_redirect_uri'
    
How to get these variables?
  1. Visit Discord Developer Portal.
  2. Create a new application or use an existing one.
  3. Open the OAuth2 section in the left panel:

image

  1. Copy the CLIENT ID:

image

  1. This is your DISCORD_CLIENT_ID.
  2. Press the "Reset Secret" button and copy the token:

image

  1. This is your DISCORD_CLIENT_SECRET.
  2. Add a redirect URL, for example:

image

  1. Start the development server and visit http://127.0.0.1:8000/oauth2/login/ to initiate the login process.

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

django_discord_oauth2-0.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

django_discord_oauth2-0.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file django_discord_oauth2-0.2.0.tar.gz.

File metadata

  • Download URL: django_discord_oauth2-0.2.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for django_discord_oauth2-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ddd073c0460c98a1e736e95d6d9b75a51af5f79833603a5af4f30e3081f08ed6
MD5 070fa26abc5996c284827a11c09874ac
BLAKE2b-256 8c9c6f52037b1b7898ad5e68501e23276650429c6c2c44a9f76a8207b0e16b9d

See more details on using hashes here.

File details

Details for the file django_discord_oauth2-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_discord_oauth2-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33345b3039b52bedcef97378d77751168888fcc141334382782e7e698139eccb
MD5 d53734a675fca85d26104376cf59c4ab
BLAKE2b-256 176824e1dd1fcdf433b6e5686ccade36da23aebecd2a4712579984afe4dda730

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