middleware.py 233 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 #-*- coding:utf-8 -*- from django.db import connection from accounts.util import set_history class MyMiddleware(object): def process_request(self, request): if request.user.is_authenticated(): set_history(request.user)