/usr/share/pyshared/threaded_multihost/middleware.py is in python-django-threaded-multihost 1.3.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # -*- coding: utf-8 -*-
""" threadlocals Middleware, provides a better, faster way to get at request and user.
:Authors:
- Herbert Poul http://sct.sphene.net
- Bruce Kroeze
Branched from [http://code.djangoproject.com/wiki/CookBookthreadlocalsAndUser CookBookThreadLocalsAndUser]
as modified by [http://sct.sphene.net Sphene Community tools].
"""
from threaded_multihost.threadlocals import set_thread_variable, set_current_user
class ThreadLocalMiddleware(object):
"""Middleware that gets various objects from the
request object and saves them in thread local storage."""
def process_request(self, request):
set_thread_variable('request', request)
set_current_user(request.user)
|