Python Django Forms Model Forms Edit an Instance

Manyung Tah
Manyung Tah
6,530 Points

The 'Updated' or 'Quiz Added' message doesnt show up when I edit or save a new quiz.

The 'Updated' or 'Quiz Added' message doesn't show up when I edit or save a new quiz.

Tim Ding
Tim Ding
11,768 Points

Hi Manyung,

I am having the same exact issue. I am seeing the messages cookie being added to my browser, but no text is displayed on the page. To me, this suggests that maybe the middleware is not displaying the cookie content. This is just my guess, and I'm not well-versed in Django architecture.

I have searched the internet quite a bit, but have not been able to find any solution to this problem. One thing I tried (you may have tried it too) was this - https://stackoverflow.com/questions/32600473/django-messages-not-showing-after-httpresponseredirect But it didn't work for me. In fact I don't see the messages cookie appear in the session storage when this setting is enabled.

My settings seem to be okay too. I have got the 'django.contrib.sessions.middleware.SessionMiddleware', and 'django.contrib.messages.middleware.MessageMiddleware' defined in MIDDLEWARE, as well as 'django.contrib.messages.context_processors.messages' in the 'context_processors' list. The ONLY difference between my copy of settings.py and the downloadable version on Treehouse is that I had to comment out #'django.contrib.auth.middleware.SessionAuthenticationMiddleware'. According to the Django doc, this class has been removed in Django 2.0. https://docs.djangoproject.com/en/2.0/releases/2.0/#miscellaneous Not sure if this has anything to do with this particular issue.

Please let me know if you have found what the problem is.

Thanks, Tim