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
-
Add
django_discord_oauth2
to yourINSTALLED_APPS
setting like this:INSTALLED_APPS = [ 'django_discord_oauth2', ]
-
Include the
django_discord_oauth2
URLconf in your projecturls.py
like this:from django.urls import include, path urlpatterns = [ path('oauth2/', include('django_discord_oauth2.urls')), ]
-
Run
python manage.py migrate
to create the necessary models. -
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?
- Visit Discord Developer Portal.
- Create a new application or use an existing one.
- Open the OAuth2 section in the left panel:
- Copy the CLIENT ID:
- This is your
DISCORD_CLIENT_ID
. - Press the "Reset Secret" button and copy the token:
- This is your
DISCORD_CLIENT_SECRET
. - Add a redirect URL, for example:
- Start the development server and visit
http://127.0.0.1:8000/oauth2/login/
to initiate the login process.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_discord_oauth2-0.3.0b1.tar.gz
.
File metadata
- Download URL: django_discord_oauth2-0.3.0b1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2840850f93255bef553f126adf08d19aad531641a43faa5e11d4c02c14fa522f |
|
MD5 | 7c49f3189f7475df398b411784fafd45 |
|
BLAKE2b-256 | cc1daabc8501789eb255bdc69e8b9382f8696d3b02a396e807c31c292b4c8e96 |
File details
Details for the file django_discord_oauth2-0.3.0b1-py3-none-any.whl
.
File metadata
- Download URL: django_discord_oauth2-0.3.0b1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54a7ac5639ddfee6a2e4331ad60a56073cbbfe17824dfc1ef15052a897a5353b |
|
MD5 | bd8768dfe45e10f4cf4ee5c0550937c1 |
|
BLAKE2b-256 | 28cf91e8fb8f55bd3f7d7b576b8259adb7a060591a17e8586689ec660a941953 |