dimanche 3 juillet 2016

Django - variables in include file not recognized

I am using djano 1.8.1 and python 2.7.

On two of my template pages I have the same set of variables.

So I decided to create an {% include %} page that holds these variables and then add the {% include %} tag on the required pages to call the variables.

However, when I set up the include file and cut and pasted the variables to the include file and added the include tag to the templates, the variables are not recognized.

No error is given, the variables are not displayed. I have checked that the path of the {% include %} tag is correct.

Is there something I have done incorrectly?

Here is a sample of the variables:

{% trans "Achievement Details" as var_details_name01 %}
{% trans "Type" as var_details_name05 %}
{% language "de" %}{% trans "Type" as var_details_name05_de %}{% endlanguage %}

Here is the include tag with the correct location:

{% include "details/achievement_details_variables.html" %}

Aucun commentaire:

Enregistrer un commentaire