Closed zavod closed 7 years ago
See #16
Replace the middleware.py source code with this, fixes the problem.
from django.utils.functional import SimpleLazyObject
from .utils import get_user_agent
class UserAgentMiddleware(object):
def __init__(self, get_response=None):
if get_response is not None:
self.get_response = get_response
def __call__(self, request):
self.process_request(request)
return self.get_response(request)
def process_request(self, request):
request.user_agent = SimpleLazyObject(lambda: get_user_agent(request))
The middleware is located in: site-packages/django_user_agents/
Hi, This is not updated on pip.
Version 0.3.2 is now on PyPI. Sorry for the delay.
It's error with Django 1.11 mw_instance = middleware(handler) TypeError: object() takes no parameters