MiddleWare Error
fmatray opened this issue · 3 comments
fmatray commented
Hello,
I get this error when I load the middleware with django 1.11:
mw_instance = middleware(handler)
TypeError: object() takes no parameters
I added this to correct the message
class AJAXMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
response = self.get_response(request)
return response
yceruto commented
Thanks for reporting this bug, I'll take a look ASAP!
yceruto commented
Sorry, I can't reproduce the issue, see passed tests for django 1.11
(https://travis-ci.org/yceruto/django-ajax/builds/269619322)
Are you sure AJAXMiddleware
is configured like this:
# settings.py
MIDDLEWARE_CLASSES = (
# ...
'django_ajax.middleware.AJAXMiddleware',
)
Note that when you're using AJAXMiddleware
you can't use @ajax
decorator at same time.
yceruto commented
Please, reopen this issue if the problem persists, thanks.