django-messages-ui 1.1.0

JS and HTML to support the Django contrib.messages app
django-messages-ui is a Django app that adds JS and HTML to support the Django contrib.messages app. It should be called on the message list element, and accepts options for message selectors, transient messages (that disappear on click or key-press), and close-links.

Messages can be dynamically added via ICanHaz.js, and there's a Python middleware to automatically add messages from the request into Ajax JSON responses.


In your Django project settings, add "messages_ui" to your INSTALLED_APPS.


Linking the JS:

< script src="{{ STATIC_URL }}messages_ui/jquery.messages-ui.js" >< /script >

Including the default HTML Template:

{% include "messages_ui/_messages.html" %}

Calling the plugin:


Calling the plugin with a variety of options explicitly configured to their default values:

 message: '.message', // Selector for individual messages
 closeLink: '.close', // Selector for link to close message
 transientMessage: '.success', // Selector for transient messages
 transientDelay: 500, // Transient message fade delay (ms)
 transientFadeSpeed: 3000, // Transient message fade speed (ms)
 handleAjax: false // Enable automatic AJAX handling

Adding a message in JS (requires ICanHaz.js):

$(ich.message({message: "Sample Message", tags: "info"}).appendTo(

To override the default JS template, add a message.html file to a directory listed in your ICANHAZ_DIRS setting (a django-icanhaz setting).


To enable automatic handling of messages from Ajax requests, add "messages_ui.middleware.AjaxMessagesMiddleware" to your MIDDLEWARE_CLASSES setting (directly after django.contrib.messages.middleware.MessageMiddleware), and pass handleAjax: true to the plugin initialization.

last updated on:
July 25th, 2012, 14:58 GMT
developed by:
Jonny Gerig Meyer
license type:
BSD License 
ROOT \ Internet \ Django Plugins
Download Button

In a hurry? Add it to your Download Basket!

user rating



Rate it!
What's New in This Release:
  • Add option for template name.
  • Make agnostic regarding templating engine, as long as template is precompiled and callable fn.
read full changelog

Add your review!