middleware.py 233 Bytes
#-*- 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)