I recently upgraded to Django 1.3 and I want to start using the Messages system.
I have added my Middleware, Template context processors and also messages into the INSTALLED_APPS
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'facebook.djangofb.FacebookMiddleware',
'annoying.middlewares.RedirectMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.request",
"django.contrib.messages.context_processors.messages",
)
INSTALLED_APPS = (
'django.contrib.messages',
)
I'm simply just testing based on a view that makes a simple calculation.
in the admin, the messages show up, however when trying to render them in my base.html file I get the following error.
Caught TypeError while rendering: 'module' object is not iterable
and in the stack it fails here.
{% for message in messages %}
I have also removed the for statement and the I still get the following error, nothing more
<module 'django.contrib.messages' from '/Users/ApPeL/.virtualenvs/mysite.com/lib/python2.7/site-packages/django/contrib/messages/__init__.py'>
Any ideas?