Django Template Language (DTL) HTML ஐ動態ভাবে உருவாக்க பயன்படுகிறது — templates HTML கோப்புகள் যা தரவு செருகுதல், looping, மற்றும் conditionals-க்கான சிறப்பு syntax ஐ கொண்டுள்ளன. இது வேண்டுமென்றே templates-ல் logic ஐ constraint செய்கிறது, presentation ஐ business logic-லிருந்து (views-ல் இருக்க வேண்டியது) தனிப்படுத்தி வைக்கிறது.
மூன்று முக்கிய syntaxes
{{ article.title }}
Author: {{ article.author.name }}
{% if user.is_authenticated %}
Welcome, {{ user.username }}
{% else %}
Log in
{% endif %}
{% for article in articles %}
{{ article.title }}
{% empty %}
No articles yet.
{% endfor %}
{{ name|upper }}
{{ article.body|truncatewords:30 }}
{{ price|floatformat:2 }}
{{ date|date:"Y-m-d" }}
