Python package to facilitate working with fastn
- Python 3.6 and above
- Django 4.0 and above
pip install fastn
-
Add
'fastn.django.GithubAuthMiddleware'
toMIDDLEWARE
afterdjango.contrib.auth.middleware.AuthenticationMiddleware
. -
By default, this middleware will create a django User from fastn session and call
login()
on this user. To change this behaviour, add the following to yoursettings.py
file:FASTN_AUTH_CALLBACK = "some.module.auth_callback"
the
some.module.auth_callback
will be called withrequest
andfastn_user
.fastn_user
is a dict:fastn_user = { "username": "john", "name": "John Do", "email": "[email protected]", }