A Django app for securely associating a user with a Discord account.
Project description
A Django app for securely associating a user with a Discord account.
This is a simple Django application that allows users to associate one or more Discord accounts to their Django accounts and automatically join a partner Discord server using the OAuth2 functionality of the Discord API.
Requirements
Python 2.7, 3.4, 3.5
Django 1.9, 1.10
Installation
Install with pip:
pip install django-discord-bind
Add discord_bind to your INSTALLED_APPS setting:
INSTALLED_APPS = [
...
'discord_bind',
]
Include the URL configuration in your project urls.py:
urlpatterns = [
...
url(r'^discord/', include('discord_bind.urls')),
]
Run python manage.py migrate to create the discord_bind models.
Configuration
Required Settings
- DISCORD_CLIENT_ID
The client identifier issued by the Discord authorization server. This identifier is used in the authorization request of the OAuth 2.0 Authorization Code Grant workflow.
- DISCORD_CLIENT_SECRET
A shared secret issued by the Discord authorization server. This identifier is used in the access token request of the OAuth 2.0 Authorization Code Grant workflow.
Optional Settings
- DISCORD_AUTHZ_PATH
The path of the authorization request service endpoint, which will be appended to the DISCORD_BASE_URI setting.
Default: /oauth2/authorize
- DISCORD_BASE_URI
The base URI for the Discord API.
Default: https://discordapp.com/api
- DISCORD_INVITE_URI
The URI that the user will be redirected to after one or more successful auto-invites.
Default: https://discordapp.com/channels/@me
- DISCORD_RETURN_URI
The URI that the user will be redirected to if no auto-invites are attempted or successful.
Default: /
- DISCORD_TOKEN_PATH
The path of the access token request service endpoint, which will be appended to the DISCORD_BASE_URI setting.
Default: /oauth2/token
License
django-discord-bind is released under the terms of the MIT license. Full details in LICENSE file.
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
Hashes for django_discord_bind-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480c793ee4c8f3124a570fb81a047dc2a47e5625e35fee3f931b214956c4208f |
|
MD5 | 2e40fcefa0466ac993163bf762ffefce |
|
BLAKE2b-256 | 23f208854d5bcfb51e051f408fbda1197ce016625652841be12dd02186db1236 |