Skip to main content

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

  1. Import the necessary classes from the library:
from flascord import DiscordOauth2Session
  1. 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'
  1. Initialize the DiscordOauth2Session instance:
discord_oauth = DiscordOauth2Session(app)
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flascord-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Flascord-0.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

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

Hashes for Flascord-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2ae43c476af11e707bb0291378fde937a2273d118301ee638118c4e885a0d332
MD5 8aaf91ad829bc8a36471f079c8e35ed7
BLAKE2b-256 8552ec0bd5f113e166b99d13205af32f43647c984348cb5d2c5e2237161b5fa1

See more details on using hashes here.

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

Hashes for Flascord-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 acf0a6e68470414041f97732acecc84c3062efca0cf71bd0ad349bb6e98f34d9
MD5 df9e3121a4dc1a6b72816cc7de937dbe
BLAKE2b-256 d334567e9a7981b1a91cc4e5ccc05dd065c950182bdc927a2d5778023ee7c0d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page