You shouldn’t use the double-bracket {{ }}
syntax within if
or ifequal
statements, you can simply access the variable there like you would in normal python:
{% if title == source %}
...
{% endif %}
More Related Contents:
- Numeric for loop in Django templates
- Can I access constants in settings.py from templates in Django?
- Rendering a template variable as HTML
- How to concatenate strings in django templates?
- django 1.5 – How to use variables inside static tag
- How can I change the default Django date template format?
- Applying bootstrap styles to django forms
- Is it possible to pass query parameters via Django’s {% url %} template tag?
- Use variable as dictionary key in Django template
- Variable subtraction in django templates
- How to set a value of a variable inside a template code?
- Django – iterate number in for loop of a template
- How do I add multiple arguments to my custom template filter in a django template?
- Django Template – Increment the value of a variable
- how to embed standalone bokeh graphs into django templates
- How do I use Django templates without the rest of Django?
- Add class to form field Django ModelForm
- Access kwargs from a URL in a Django template
- Django templates: value of dictionary key with a space in it
- Django – Simple custom template tag example
- Grouped CheckboxSelectMultiple in Django template
- How to access outermost forloop.counter with nested for loops in Django templates?
- Django templates: verbose version of a choice
- How to get URL of current page, including parameters, in a template?
- Django how to pass custom variables to context to use in custom admin template?
- {% include %} vs {% extends %} in django templates
- Django templates folders
- How do I display the value of a Django form field in a template?
- How do you limit list objects template side, rather than view side
- Override existing Django Template Tags