Search code examples
djangotwitter-bootstrappnotify

How to use notify in Django with Bootstrap?


Trying to put those notification system on my templates.

I use a:

{% for message in messages %}
    <<What I need to put here to create a notifiy for each error message??>>
{% endfor %}

Solution

  • Solved with:

    <script>
    {% for message in messages %}
    $(document).ready(function() {
        $.pnotify({
            title: '{{ message.tags|upper }}',
            text: '{{ message }}.',
            type: '{{ message.tags }}',
            hide: false,
            styling: 'bootstrap',
            closer_hover: false,
            sticker_hover: false
        });
    });
    {% endfor %}
    </script>