Skip to content

Instantly share code, notes, and snippets.

View DelgadoPanadero's full-sized avatar

Ángel Delgado DelgadoPanadero

View GitHub Profile
@DelgadoPanadero
DelgadoPanadero / fastapi_globals.py
Created August 24, 2022 17:54 — forked from ddanier/fastapi_globals.py
flask.g for FastAPI.
"""
This allows to use global variables inside the FastAPI application
using async mode.
# Usage
Just import `g` and then access (set/get) attributes of it:
```python
from your_project.globals import g