Skip to content

fastn-stack/fastn_py

fastn_py

Python package to facilitate working with fastn

Requirements

  • Python 3.6 and above
  • Django 4.0 and above

Installation

pip install fastn

GithubAuthMiddleware

  • Add 'fastn.django.GithubAuthMiddleware' to MIDDLEWARE after django.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 your settings.py file:

    FASTN_AUTH_CALLBACK = "some.module.auth_callback"

    the some.module.auth_callback will be called with request and fastn_user. fastn_user is a dict:

    fastn_user = {
        "username": "john", 
        "name": "John Do", 
        "email": "[email protected]", 
    }