No project description provided
Project description
Flascord: Discord OAuth2 Integration for Flask
Flascord is a Python library that simplifies the integration of Discord OAuth2 authentication into your Flask web applications.
Installation
You can easily install Flascord using pip:
pip install flascord
Usage
- Import the necessary classes from the library:
from flascord import DiscordOauth2Session
- Set up the required configuration in your Flask app:
app.config['DISCORD_CLIENT_ID'] = 'your_client_id'
app.config['DISCORD_CLIENT_SECRET'] = 'your_client_secret'
app.config['DISCORD_REDIRECT_URI'] = 'your_redirect_uri'
app.config['DISCORD_BOT_TOKEN'] = 'your_bot_token'
- Initialize the
DiscordOauth2Sessioninstance:
discord_oauth = DiscordOauth2Session(app)
- Implement the necessary routes for OAuth2 authorization:
@app.route("/login")
def login():
return discord_oauth.login()
@app.route("/refresh")
def refresh():
return discord_oauth.refresh()
@app.route("/callback/")
def callback():
discord_oauth.callback()
return redirect(url_for(".success"))
@app.route("/success")
def success():
return "success"
Contributing
If you encounter any issues or would like to contribute, please feel free to open an issue or pull request on the GitHub repository.
License
Flascord is released under the MIT License.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Flascord-0.1.1.tar.gz.
File metadata
- Download URL: Flascord-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ae43c476af11e707bb0291378fde937a2273d118301ee638118c4e885a0d332
|
|
| MD5 |
8aaf91ad829bc8a36471f079c8e35ed7
|
|
| BLAKE2b-256 |
8552ec0bd5f113e166b99d13205af32f43647c984348cb5d2c5e2237161b5fa1
|
File details
Details for the file Flascord-0.1.1-py3-none-any.whl.
File metadata
- Download URL: Flascord-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acf0a6e68470414041f97732acecc84c3062efca0cf71bd0ad349bb6e98f34d9
|
|
| MD5 |
df9e3121a4dc1a6b72816cc7de937dbe
|
|
| BLAKE2b-256 |
d334567e9a7981b1a91cc4e5ccc05dd065c950182bdc927a2d5778023ee7c0d8
|