I avec django 1.11 programmant, maintenant je le script suivant dans post_list.htmlImpossible d'analyser le reste: {{request.LANGUAGE_CODE}} 'de '{{request.LANGUAGE_CODE}}'
{% with lang={{request.LANGUAGE_CODE}} %}
{% endwith %}
<p>
{% if lang == 'zh-CN' %} {{object.category.name_zh_CN}} {% else %} {{object.category.name}} {% endif %}
</p>
mais je ne peux pas obtenir réellement avec le message d'erreur suivant, s'il vous plaît help.Thanks.
TemplateSyntaxError at /adv/australia-strategic/
Could not parse the remainder: '{{request.LANGUAGE_CODE}}' from '{{request.LANGUAGE_CODE}}'
Request Method: \t GET
Request URL: \t http://localhost:8030/adv/australia-strategic/
Django Version: \t 1.11.6
Exception Type: \t TemplateSyntaxError
Exception Value: \t
Could not parse the remainder: '{{request.LANGUAGE_CODE}}' from '{{request.LANGUAGE_CODE}}'
Exception Location: \t /Users/wzy/anaconda2/envs/python36/lib/python3.6/site-packages/django/template/base.py in __init__, line 700
Python Executable: \t /Users/wzy/anaconda2/envs/python36/bin/python
Python Version: \t 3.6.3
Python Path: \t
['/Users/wzy/expo3/expo',
'/Users/wzy/anaconda2/envs/python36/lib/python36.zip',
'/Users/wzy/anaconda2/envs/python36/lib/python3.6',
'/Users/wzy/anaconda2/envs/python36/lib/python3.6/lib-dynload',
'/Users/wzy/anaconda2/envs/python36/lib/python3.6/site-packages',
'/Users/wzy/expo3/expo']
'lang' var ne fonctionnera pas hors de portée' de with' de templatetag –
grâce Je suis entièrement résolu ce problème avec votre aide bien voulu. –