Thread specific global variables with middleware to hold a reference to the current user.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



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

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


Install using pip

   pip install django_globals


In your project's, add django_globals.middleware.Global to MIDDLEWARE (or MIDDLEWARE_CLASSES on Django < 1.10).


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


For more information see the documentation at:

If you have questions or have trouble using the app please file a bug report at: