Reputation: 120
I'm reading an entire page's content from database and render them in a HTML file. Here are some examples. In database:
<a href="{% url 'home_view' %}></a>
In order to avoid escape of HTML tags, I use {{ page.content|safe }}
But I couldn't render {% url 'home_view' %}
Upvotes: 2
Views: 176
Reputation: 936
You can control auto-escaping behavior using autoescape
template tag. In your case, you can use the below snippet.
{% autoescape off %}{{ page.content }}{% endautoescape %}
You can get more information in autoescape Documentation
Upvotes: 1