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.3.0b1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

django_discord_oauth2-0.3.0b1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file django_discord_oauth2-0.3.0b1.tar.gz.

File metadata

File hashes

Hashes for django_discord_oauth2-0.3.0b1.tar.gz
Algorithm Hash digest
SHA256 2840850f93255bef553f126adf08d19aad531641a43faa5e11d4c02c14fa522f
MD5 7c49f3189f7475df398b411784fafd45
BLAKE2b-256 cc1daabc8501789eb255bdc69e8b9382f8696d3b02a396e807c31c292b4c8e96

See more details on using hashes here.

File details

Details for the file django_discord_oauth2-0.3.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_discord_oauth2-0.3.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 54a7ac5639ddfee6a2e4331ad60a56073cbbfe17824dfc1ef15052a897a5353b
MD5 bd8768dfe45e10f4cf4ee5c0550937c1
BLAKE2b-256 28cf91e8fb8f55bd3f7d7b576b8259adb7a060591a17e8586689ec660a941953

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