Created
July 16, 2014 06:34
-
-
Save kelp404/e5f1079c3910fd4f2238 to your computer and use it in GitHub Desktop.
GlobalMiddleware in Python django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
g = threading.local() | |
class GlobalMiddleware(object): | |
""" | |
Global variable. | |
""" | |
def process_request(self, request): | |
g.request = request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment