Wednesday, 15 June 2011

python - rendering html in django template? -


I know that this question has been asked before, but none of them is working in my case. My HTML string is being provided as much as it is. I am storing a successful message like this:

  msg = 'You & lt; A href = "some_url" & gt; Getting started with MDN & lt; / A & gt; Messages.success (request, message)  

and the notification is stored in the [] variable:

  {% Message%} Notifications: [ Message in% message {} {% message.tags or waffle.flag ('redirect_messages')%} {Message: {% autoescape off%} "{{message}}" {% endautoescape%}, no 'wiki_redirect' in tag Is: "{{Message.tags}}", Level: "{{message | level_tag}}"} {% if not loop.last%}, {% endif%} {% endif%} {% endfor%}] , {% Else%} Notification: [], {% endif%}  

Is there a syntax error? If I render it directly, then this method works. However, notification: [message: Using "{{message | safe}}" or autoescape, the message does not seem to be stored securely both.


No comments:

Post a Comment