pythondjangodjango-messages

Django messages: how can i change message text in html?


View:

messages.add_message(request, messages.ERROR, 'Cells marked incorrectly.')

HTML:

{% if messages %}
    <ul class="messages">
        {% for message in messages %}
                <li class="{{ message.tags }}">
                {{ message }}
            </li>
        {% endfor %}
    </ul>
{% endif %}

Problem: I need to remove marker which you can see on the related picture. I read so many documentation and forums and find nothing. Maby somebody faces this problem and can help me.


Solution

  • consider a simple html, beacause django template engine in the end gives you something like this:

     <ul class="messages-no-bullets">
             <li class="{{ message.tags }}">
                Test1
            </li>
            <li class="{{ message.tags }}">
                Test2
            </li>
        </ul>
    

    so using CSS you can do this:

    .messages-no-bullets li{
      list-style-type: none;
    }