Skip to content

Instantly share code, notes, and snippets.

@tarkatronic
Last active June 25, 2017 20:35
Show Gist options
  • Save tarkatronic/a22e5f2ffdf20825e0fcfc849db6e447 to your computer and use it in GitHub Desktop.
Save tarkatronic/a22e5f2ffdf20825e0fcfc849db6e447 to your computer and use it in GitHub Desktop.
Django Bootstrap Messages
{% if messages %}
{% for message in messages %}
<div class="alert{% if message.tags %}{% if message.tags == "error" %} alert-danger{% else %} alert-{{ message.tags }}{% endif %}{% endif %}" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
{{ message }}
</div>
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment