Skip to content

Instantly share code, notes, and snippets.

@rochacbruno
rochacbruno / fastapi_session.py
Last active September 20, 2024 11:23
Session based cookie auth fastapi
from fastapi import Request, Depends, HTTPException, Response
from fastapi.responses import RedirectResponse
# This must be randomly generated
RANDON_SESSION_ID = "iskksioskassyidd"
# This must be a lookup on user database
USER_CORRECT = ("admin", "admin")
# This must be Redis, Memcached, SQLite, KV, etc...
@kachmul2004
kachmul2004 / CELERYCONFIG.md
Last active December 6, 2022 21:53 — forked from hamzaakhtar953/CELERYCONFIG.md
Configuring Celery + Redis + Supervisor with Django

Configuring Celery + Redis + Supervisor with Django

Install Celery

$ pip install celery
$ pip install redis

Install Celery Broker