ticket:3 added middleware.py and appropriately settings