Middleware to log username into apache logs with mod_python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
class ModPythonSetLoggedinUser(object):
    def process_request(self, request):
        if not isinstance(request, ModPythonRequest):
            return None

        if not hasattr(request, '_req'):
            return None

        if not hasattr(request, 'user') or not request.user.is_authenticated():
            return None

        request._req.user = request.user.username

        return None

More like this

  1. Log username in Apache access logs by arthur 4 years, 1 month ago
  2. Log Django exceptions to Apache error log in mod_wsgi by simon 4 years, 7 months ago
  3. Custom mod_python AuthenHandler by aeby 6 years, 8 months ago
  4. apache authentication via cookies by sean 7 years, 1 month ago
  5. Registering Facebook user by username before loggin in by zjor 10 months, 2 weeks ago

Comments

(Forgotten your password?)