Few middleware problems? Django 1.11.2
See original GitHub issuemiddleware.py
our_decorator = watch_login()
watch_login_method = method_decorator(our_decorator)
Whats the point of this mess? Besides it throwing TypeError: watch_login() takes exactly 1 argument (0 given) can’t it be just one line like it was before?
Like this: watch_login_method = method_decorator(watch_login)
Also for django-defender to work with the new django MIDDLEWARE I need to do the following to the middleware:
try:
from django.utils.deprecation import MiddlewareMixin as MIDDLEWARE_BASE_CLASS
except ImportError:
MIDDLEWARE_BASE_CLASS = object
Add this on top of the middleware.py and then swap the class FailedLoginMiddleware(object): to class FailedLoginMiddleware(MIDDLEWARE_BASE_CLASS):
Without doing these changes to the current middleware.py django runserver doesn’t even “start”. I am on django 1.11.2
Is the current 0.5 version actually running on someones django 1.11.x project? 😂
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Middleware - Django documentation
Middleware is a framework of hooks into Django's request/response processing. It's a light, low-level “plugin” system for globally altering Django's input or ...
Read more >After upgrade to Django 1.11 append_slash no longer works
No, SessionAuthenticationMiddleware shouldn't cause any problems. In Django 1.11 it's a stub class for backwards compatibility reasons. It doesn ...
Read more >Django 2.2 Upgrade Issues and Lessons Learned
This is a collection of issues we encountered with the Django 2.2 upgrade and ... use the newer style of Django middleware introduced...
Read more >TypeError: __init__() takes exactly 2 arguments (1 given) #25
Django ==1.11.8 aws-xray-sdk==0.95 Traceback (most recent call last): ... Changing to MIDDLEWARE got rid of the error in this issue but is ...
Read more >10 Tips for Upgrading to Django 2.0 - Eldarion
The much anticipated Django 2.0 was recently released and we are updating Pinax ... to share our process and some of the most...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Temeez can we close this issue?
Odd, I don’t get the
TypeErrorfrom thewatch_login()anymore and I have done no code changes… magic!I’ll make a PR for the MIDDLEWARE thing so it won’t throw
TypeError: object.__init__() takes no parameterserror.