I am trying to use the Django include tag for the first time and am having some issues. I have written the code below but it gives me an error. I am trying to include a html page which differs for each ‘special’ (database defined in main.py). The field {{ special.text }} contains a unique website address which should be loaded.
{% for special in specials|dictsort:"register_date" reversed %}
<div class="specials_content {{ special.city }}">
{% include {{ special.text }} %}
</div>
{% endfor %}
The error I get is:
TemplateSyntaxError: ‘include’ tag takes one argument: the name of the template to be included
Now I think that this is because I have to define it as a variable, but unfortunately I don’t understand how to make a variable out of it. Can anybody help?
Second example here.