Put a <a> hyperlink in a django message [duplicate]
This question already has answers here : Closed 3 years ago . How do I output HTML in a message in the new Django messages framework? (7 answers) I'm using django messages and i want to put an hyperlink in it. view.py: from django.contrib import messages def my_view(request): messages.info(request,"My message with an <a href='/url'>hyperlink</a>") Obviously, in my page, i see the html code and no hyperlink. How to treat the message as an htlml code ? Hope this is clear. Strings in Django templates are automatically escaped. You don't want your raw HTML to be auto-escaped, so you should either