Django Template

Use static in template:

{% load static %}
{% static 'css/main.css' %}
{% extends 'base.html' %}
{% block content %}
{% endblock %}
{% include 'header.html' %}
{% if user.username = 'Mike' %}
	<p>Hello Admin</p>
{% else %}
	<p>Hello User</p>
{% endif %}
{% for product in products %}
	<p>The product name is {{ product }}<p>
{% endfor %}
{{ var_name }}

Template variables formatting

{{ title | lower }}
{{ blog.post | truncatwords:50 }}
{{ order.date | date:"D M Y" }}
{{ list_items | slice:":3" }}
{{ total | default:"nil" }}

Current path (ex. posts/1/show)

{{ request.path }}

URL by name with parameter

{% url 'posts.delete' [id=post.id](http://id=post.id/) %}