Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrf0rtuna4/django-discord-oauth2
🥢 Django application for secure user authorisation using Discord OAuth2
https://github.com/mrf0rtuna4/django-discord-oauth2
discord django oauth2 pypi
Last synced: about 9 hours ago
JSON representation
🥢 Django application for secure user authorisation using Discord OAuth2
- Host: GitHub
- URL: https://github.com/mrf0rtuna4/django-discord-oauth2
- Owner: mrf0rtuna4
- License: apache-2.0
- Created: 2024-08-01T18:55:30.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-09-29T16:34:51.000Z (about 1 month ago)
- Last Synced: 2024-10-30T12:08:56.092Z (8 days ago)
- Topics: discord, django, oauth2, pypi
- Language: Python
- Homepage: https://pypi.org/project/django-discord-oauth2/
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Django & Discord Oauth2
> [!WARNING]
> App under development!!## Installation
```bash
pip install django-discord-oauth2
```## Usage
1. Add `django_discord_oauth2` to your `INSTALLED_APPS` setting like this:
```python
INSTALLED_APPS = [
'django_discord_oauth2',
]
```2. Include the `django_discord_oauth2` URLconf in your project `urls.py` like this:
```python
from django.urls import include, pathurlpatterns = [
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:
```python
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](https://discord.com/developers/applications).
2. Create a new application or use an existing one.
3. Open the OAuth2 section in the left panel:![image](https://github.com/user-attachments/assets/face3685-4ee8-4c9e-a706-dc634069220b)
5. Copy the CLIENT ID:
![image](https://github.com/user-attachments/assets/0e76649b-3d9b-4a5c-8744-d19fc3257d24)
7. This is your `DISCORD_CLIENT_ID`.
8. Press the "Reset Secret" button and copy the token:![image](https://github.com/user-attachments/assets/d2b899b3-84f4-42b0-8e4f-6a72979aaa30)
10. This is your `DISCORD_CLIENT_SECRET`.
11. Add a redirect URL, for example:![image](https://github.com/user-attachments/assets/d43dada4-cd0d-4cfe-bdea-39638cb0fee1)
5. Start the development server and visit `http://127.0.0.1:8000/oauth2/login/` to initiate the login process.
---
## Contributing
Contributions are welcome! Please read the [contributing guidelines](CONTRIBUTING.md) to get started.
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.