Tags

Programming languages can do more than just display variables. Django's template language has many familiar syntactic forms, such as if and for. They should be written in the tag syntax such as {% if %}. Several template-specific forms, such as include and block, are also written in the tag syntax.

In Python shell:

>>> if 1==1:
...     print(" Date is {0} ".format(time.strftime("%d-%m-%Y")))
 Date is 30-05-2018

The following is its corresponding Django template form:

    {% if 1 == 1 %} Date is {% now 'd-m-Y' %} {% endif %}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.145.114