The following error is being thrown by my Django code on my VPS when I try to use messages:
You cannot add messages without installing django.contrib.messages.middleware.MessageMiddleware
Exception Type: MessageFailure
Exception Value:
You cannot add messages without installing django.contrib.messages.middleware.MessageMiddleware
I do have all the appropriate settings in my settings.py file. My VPS is running Django 1.9.6. The same error is not thrown when I run the code locally on my laptop. On my laptop, I have Django 1.10.3 running. Are there any differences in the treatment of messages between Django 1.9.6 and 1.10.3 that would cause this to happen? It seems that on Django 1.9.6 my settings in settings.py are being ignored.
Relevant code in settings.py is as follows:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
]
Any help would be greatly appreciated. Thanks.