Django Template Language (DTL) HTML ને ગતિશીલ રીતે બનાવવા માટે વપરાય છે — templates એ HTML ફાઇલો છે જેમાં ડેટા શામેલ કરવા, લૂપ કરવા અને શરતી જોગવાઈ માટે વિશેષ સિન્ટેક્સ હોય છે. તે જાણીજોઈને templates માં તર્ક મર્યાદિત રાખે છે, તથ્યોને વ્યવસાય તર્ક (જે 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" }}
