I would like to improve my django message
with some things : add a breakline
in the text and add an url using django reverse url
.
This is my message :
messages.error(self.request, _( f"The link to download the document has expired. Please request it again in our catalogue : {redirect to freepub-home}"
I would like to separate my message by adding a new line after the .
in order to get something like this :
messages.error(self.request, _( f"The link to download the document has expired.
Please request it again in our catalogue : {redirect to freepub-home}"
Then, how I can set django redirection in my message thanks to reverse url to "freepub-home"
?
Thank you by advance !
EDIT :
I overcome to set breakline :
messages.error(self.request, mark_safe(
"The link to download the document has expired."
"<br />"
"Please request it again in our catalogue :
<a href='{% url "freepub-home" %}'> my link </a>")
But I don't find up to now how I can pass django url inside because I have an issue with quote and double quotes.