mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-09 20:09:30 +02:00
Use configs from Flask app instance
This commit is contained in:
16
README.md
16
README.md
@@ -16,15 +16,15 @@ python3 -m pip install Flask-Discord
|
||||
from flask import Flask, redirect, url_for
|
||||
from flask_discord import DiscordOAuth2Session
|
||||
|
||||
CONFIGS = {
|
||||
"client_id": 9999999999,
|
||||
"client_secret": "your client secret",
|
||||
"redirect_uri": "default redirect uri",
|
||||
}
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = "random bytes representing flask secret key"
|
||||
discord = DiscordOAuth2Session(**CONFIGS)
|
||||
|
||||
app.secret_key = b"random bytes representing flask secret key"
|
||||
|
||||
app.config["DISCORD_CLIENT_ID"] = 490732332240863233 # Discord client ID.
|
||||
app.config["DISCORD_CLIENT_SECRET"] = "" # Discord client secret.
|
||||
app.config["DISCORD_REDIRECT_URI"] = "" # Redirect URI.
|
||||
|
||||
discord = DiscordOAuth2Session(app)
|
||||
|
||||
|
||||
@app.route("/login/")
|
||||
|
||||
Reference in New Issue
Block a user