I am allowing users to create custom templates, and when doing so they are building off of my own base template with context variables.
So my own template that is used as a base will have a line such as…
<h3>1.0: Contract Specifics for {{ first_name }}</h3>
Now when the user edits this form I am escaping the curly brackets so they store as actual curly brackets in the form field when the user saves their custom template.
Now a user will click save and in the model field there will be raw HTML stored as a TextField
and is stored in the database as such…
Now I need to render this in my django template later on but, I need {{ first_name }}
and other termplate tags to be replaced with the actual context variable. unfortunately in my django template when I render this specific form field to display the HTML
{% autoescape off %}
{{ contract_detail }}
{% endautoescape %}
it displays as… 1.0: Contract specifics for {{first_name}}
Is there anyway to force django to recognize this as a template variable and render this correctly, maybe I need some sort of custom functionality, or templatetag?