Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

django-authtkt is used to share auth between more than one django site (a kind of SSO auth)

Project Description


Add the middlware class before the AuthenticationMiddleware:



You can use a callback to use something to fill the newly created user in the third party app.


AUTHTKT_CALLBACK = 'yourmodule:update_user'


from sqlalchemy import engine_from_config, Table, MetaData
from django.conf import settings

def update_user(user):
    engine = engine_from_config({'sqlalchemy.url': settings.USER_DB})
    metadata = MetaData(engine)
    users = Table('auth_user', metadata, autoload=True)
    record =
    for k, v in record.items():
        setattr(user, str(k), v)

Manual identify/forget user

Manualy identify user (eg: set a cookie). You need to set a correct request.user:

request.environ['authtkt.identify'](request, response)

Manualy forget user (eg: reset a cookie):

request.environ['authtkt.forget'](request, response)

Release History

This version
History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.0 kB) Copy SHA256 Hash SHA256
Source None May 19, 2011
(11.4 kB) Copy SHA256 Hash SHA256
Source None May 19, 2011

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting