Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Thread specific global variables with middleware to hold a reference to the current user.
branch: master
Failed to load latest commit information.
src/django_globals set globals.user to None if there is no user, second try, better
.gitignore
AUTHORS New version 0.2 which also save the Request
ChangeLog Version 0.2.1 with ReST long description for PyPi.
LICENSE License and readme.
MANIFEST.in All code was moved to 'src' directory.
README.md Update README.md
setup.py Version 0.2.1 with ReST long description for PyPi.

README.md

Django-globals

changelog

Django-globals, is a very simple application, that allow to define a thread specific global variables.

Also, it includes a middleware Global, which can be used, to access to the current request and user outside a view, when "request" variable is not defined.

Installation

Install django_globals using pip.

Next, add django_globals to the INSTALLED_APPS and django_globals.middleware.Global to the MIDDLEWARE_CLASSES.

Now you can make from django_globals import globals and access to the globals.request and globals.user from anywhere.

Something went wrong with that request. Please try again.