All Projects → nwunderly → starlette-discord

nwunderly / starlette-discord

Licence: MIT License
"Login with Discord" support for Starlette and FastAPI

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to starlette-discord

fastapi-tdd-docker
Test-Driven Development with FastAPI and Docker
Stars: ✭ 89 (+493.33%)
Mutual labels:  starlette, fastapi
fastapi-azure-auth
Easy and secure implementation of Azure AD for your FastAPI APIs 🔒 B2C, single- and multi-tenant support.
Stars: ✭ 174 (+1060%)
Mutual labels:  oauth2, fastapi
fastapi-websocket-broadcast
Websocket 'broadcast' demo using FastAPI/Starlette
Stars: ✭ 106 (+606.67%)
Mutual labels:  starlette, fastapi
Awesome Fastapi
A curated list of awesome things related to FastAPI
Stars: ✭ 3,033 (+20120%)
Mutual labels:  starlette, fastapi
myChat
MyChat es una aplicación de mensajería en tiempo real con servidores de Discord (similar a un canal de Discord).
Stars: ✭ 30 (+100%)
Mutual labels:  oauth2, discord-api
starlette-context
Middleware for Starlette that allows you to store and access the context data of a request. Can be used with logging so logs automatically use request headers such as x-request-id or x-correlation-id.
Stars: ✭ 320 (+2033.33%)
Mutual labels:  starlette, fastapi
inboard
🚢 Docker images and utilities to power your Python APIs and help you ship faster. With support for Uvicorn, Gunicorn, Starlette, and FastAPI.
Stars: ✭ 106 (+606.67%)
Mutual labels:  starlette, fastapi
morelia server
Server for MoreliaTalk network
Stars: ✭ 25 (+66.67%)
Mutual labels:  starlette, fastapi
fastapi-users
Ready-to-use and customizable users management for FastAPI
Stars: ✭ 1,920 (+12700%)
Mutual labels:  starlette, fastapi
fastapi-zeit-now
A simple example of deploying FastAPI as a Zeit Serverless Function
Stars: ✭ 24 (+60%)
Mutual labels:  starlette, fastapi
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+263820%)
Mutual labels:  starlette, fastapi
msgpack-asgi
Drop-in MessagePack support for ASGI applications and frameworks
Stars: ✭ 100 (+566.67%)
Mutual labels:  starlette, fastapi
starlette-graphene3
An ASGI app for using Graphene v3 with Starlette / FastAPI
Stars: ✭ 52 (+246.67%)
Mutual labels:  starlette, fastapi
starlette-opentracing
Opentracing support for Starlette and FastApi
Stars: ✭ 62 (+313.33%)
Mutual labels:  starlette, fastapi
arel
Lightweight browser hot reload for Python ASGI web apps
Stars: ✭ 69 (+360%)
Mutual labels:  starlette, fastapi
serverless-mangum-examples
Example ASGI applications and Serverless Framework configurations using Mangum
Stars: ✭ 26 (+73.33%)
Mutual labels:  starlette, fastapi
Flask-Discord
Discord OAuth2 extension for Flask. An Easier implementation of "Log In With Discord".
Stars: ✭ 123 (+720%)
Mutual labels:  oauth2, discord-oauth2-extension
esp32-weather-google-sheets
Weather station based on ESP32 and MicroPython with sending data to Google Sheets
Stars: ✭ 48 (+220%)
Mutual labels:  oauth2
poem
A full-featured and easy-to-use web framework with the Rust programming language.
Stars: ✭ 1,167 (+7680%)
Mutual labels:  fastapi
odata2poco
generate POCO classes from OData service
Stars: ✭ 42 (+180%)
Mutual labels:  oauth2

Starlette-Discord

"Login with Discord" support for Starlette and FastAPI

starlette-discord is a Discord OAuth2 module intended for use with Starlette and FastAPI.

Installing

starlette-discord can be installed with the command

# Linux
python3 -m pip install -U starlette-discord

# Windows
python -m pip install -U starlette-discord

To install the development version of the library directly from source:

$ git clone https://github.com/nwunderly/starlette-discord
$ cd starlette-discord
$ python3 -m pip install -U .

Quickstart

Below is an example FastAPI app implementing Discord's OAuth flow to identify the user.

import uvicorn
from fastapi import FastAPI
from starlette_discord import DiscordOAuthClient

client_id = "YOUR APP'S CLIENT ID HERE"
client_secret = "YOUR APP'S CLIENT SECRET HERE"
redirect_uri = "http://localhost:8000/callback"

app = FastAPI()
discord_client = DiscordOAuthClient(client_id, client_secret, redirect_uri)

@app.get('/login')
async def start_login():
    return discord_client.redirect()

@app.get('/callback')
async def finish_login(code: str):
    user = await discord_client.login(code)
    print(user)
    return user

uvicorn.run(app)

To begin the OAuth authorization flow with this app, visit http://localhost:8000/login.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].