Skip to content
This repository

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

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 ChangeLog
Octocat-spinner-32 LICENSE
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.md
Octocat-spinner-32 setup.py
README.md

Django-globals

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

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

Installation

Download sources, add place django_globals somewhere in yours python path.

Next, add django_globals to the INSTALLED_APPS and, optionally, 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 anywhere.

Something went wrong with that request. Please try again.