Tried tonnes of stuff out there but none of them really helped.
I have a URL
for example:
http://localhost:8000/user/edit-transaction/?object_id
In my case modifying the MESSAGE_STORAGE
value as mentioned by @ParagTyagi was not enough. I was having custom change_list.html
templates for some admin classes and in those I had to add the following code:
{% if messages %}
{% endif %}
Notice that I've commented the tag, otherwise the messages are duplicated.
In addition, there has to be more than one message in the messages
object. Otherwise, the messages are not displayed neither. If you have just one message to display (e.g. a confirmation of a success operation), then just add another empty message like:
messages.add_message(self.request, messages.WARNING, "")
After the modifications, remember to restart your web server (e.g. Apache) and clear your browser cache.