I do not think you need to use middleware. A special template tag will work for this. Since you are doing something like a status message, it will not be related to any current view, so the tag is definitely suitable.
Just set up a cache server ( this is very easy to do ) and you will have access to cache.set() and cache.get() , which you can use to store and receive your status message. Be sure to clear the cache when updating the status message.
source share