Closed tusharcoder closed 6 years ago
Does it work with non-extended (standard) middleware?
# DJK_MIDDLEWARE = 'hcl.middleware.ContextMiddleware'
DJK_MIDDLEWARE = 'django_jinja_knockout.middleware.ContextMiddleware'
Do you really need to extend built-in djk middleware? See an example of extended middlware at https://github.com/Dmitri-Sintsov/djk-sample/blob/master/djk_sample/middleware.py
I also have an private project with much more large extended djk middleware that works (in Django 1.11).
Locally the tests passed with Django 2.0.
I just used the default 'django_jinja_knockout.middleware.ContextMiddleware'
It also didn't work with the extended Middleware that I made( DJK_MIDDLEWARE = 'hcl.middleware.ContextMiddleware) that I commented out But If I didn't apply any Middleware then there is no error.
I figured out why you are getting this error in Django 2.0. Only git master of django-jinja-knockout 0.7.0 which is unreleased to pypi yet is Django 2.0 compatible. pypi has only 0.6.0 version, which produces the same error in my test app. Please try to use git master version until 0.7.0 is released at pypi:
python -m pip install git+https://github.com/Dmitri-Sintsov/django-jinja-knockout.git
Or wait unitil I build-up and finish version 0,7,0 release and upload it to pypi, so it will be possible to use pypi fixed version. I will inform you about the release via the message in this thread.
Sorry for the inconvenience!
Version 0.7.1 is released: https://pypi.python.org/pypi?:action=display&name=django-jinja-knockout&version=0.7.1
So, Django 2.0 is supported "out of box" now with normal installation from pypi:
python3 -m pip install django-jinja-knockout
Error related to middleware
DJK_MIDDLEWARE
TypeError: init() takes 1 positional argument but 2 were given
My Settings.py
Please help what am I missing ??