13👍
try changing the MIDDLEWARE_CLASSES
MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
]
14👍
I had a similar problem with when upgrading my app to django 1.10. First I would try changing MIDDLEWARE_CLASSES to MIDDLEWARE because with Django 1.10 they introduced a new style of middleware outline here:
https://docs.djangoproject.com/en/1.10/releases/1.10/
If that doesn’t work, I would suggest checking your django middleware files, I had to change all classes that took object to MiddlewareMixin which you can import by calling:
from django.utils.deprecation import MiddlewareMixin
In my case I changed
class SiteMiddleware(object):
...
to
from django.utils.deprecation import MiddlewareMixin
class SiteMiddleware(MiddlewareMixin):
...
- [Django]-Missing staticfiles manifest entry in Django deployment using Heroku
- [Django]-Import data into Django model with existing data?
- [Django]-Implement zeromq publisher in django with celery (Broker redis)
- [Django]-Django auto logout and page redirection
2👍
I tried directly in Django 1.10! Initially it showed
“TypeError: object() takes no parameters” error.
After I changed MIDDLEWARE to MIDDLEWARE_CLASSES in my settings.py, it worked!
- [Django]-Django makemigrations No changes detected in app
- [Django]-NoReverseMatch: with arguments '()' and keyword arguments
- [Django]-Where to put Django comments moderation code?
1👍
I would add that in addition to what mol mentioned, during process of upgrading Django I had to temporary disable the linked virtual host. Also try freshly upgrading to Django 1.10 (uninstall Django 1.9, then install Django 1.10).
You might need to additionally clear all Django sessions as well.
- [Django]-Django Import Issue
- [Django]-Django-Userena: adding extra non-null fields to a user's profile