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.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddd073c0460c98a1e736e95d6d9b75a51af5f79833603a5af4f30e3081f08ed6 |
|
MD5 | 070fa26abc5996c284827a11c09874ac |
|
BLAKE2b-256 | 8c9c6f52037b1b7898ad5e68501e23276650429c6c2c44a9f76a8207b0e16b9d |
File details
Details for the file django_discord_oauth2-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_discord_oauth2-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33345b3039b52bedcef97378d77751168888fcc141334382782e7e698139eccb |
|
MD5 | d53734a675fca85d26104376cf59c4ab |
|
BLAKE2b-256 | 176824e1dd1fcdf433b6e5686ccade36da23aebecd2a4712579984afe4dda730 |