Django template
23.12.2023
16
0
0
0
This is a text document marked up with a special syntax for inserting new code.
Django projects by default use their own template language called DTL. But, you can also switch to other template languages, if necessary and desired. And if you want even more, you can write your own template language.
All template functionality can be divided into the following elements:
- {{ VARIABLE }}
- {% TAG %}
- {{ SOME_VALUE|filtr }}
- {% comment %} Mulit line comment {% endcomment%}
- {# One line comment #}
- Cycles {% for el in elements %} {# Counter from 1 #} {{forloop.counter}} {# Counter from 0 #} {{forloop.counter0}} {% endfor %}
- Conditions {% if CONDITION %} {% elif CONDITION %} {% else %} {% endif %}
Used in
In this article I will show how I implemented commenting on my website. Commenting, which is available to both anonymous and registered users.
Let me make a reservation right away that the authentication system that you and I will write is not based on the built-in Django application, django.contrib.auth. This will be a separate application with a separate model for it.
I will be busy developing a new project. His name is SearchResultParser. Its essence is to parse data from the search results of various search engines, such as google, youtube, yandex and others.
SEO recommendations from Google were used to improve the paginator and infinite scroll using replace and push states for the URL. A tag system was also developed for the site. A gallery was added.
This is an article that is going to introduce you to my new project/webtool, SearchResultParser. Also, from this article, you can navigate to any interesting article for you. See them in the end.