A collection of built-in template tags and filters for django templates.
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
ext install StuartElimu.django-template-snippets
blk
{% block content %}{% endblock content %}
There are a couple of options for different types of block e.g title, content.
com
{% comment %}|{% endcomment %}
csrf
{% csrf_token %}
ext
{% extends 'base.html' %}
By default base.html
is suggested but you can change the name of the file.
for
{% for | in | %}
|
{% endfor %}
foremp
{% for | in | %}
|
{% empty %}
|
{% endfor %}
if
{% if | %}
|
{% endif %}
incl
{% include 'partial.html' %}
ld
{% load static %}
sta
{% static 'images/hi.jpg' %}
url
{% url '|' | %}
wi
{% with |=| %}
|
{% endwith %}
{{
{{ | }}
{#
{# | #}
The
|
character shows the cursor positions where you can insert or change content. All unknown abbreviations will be transformed to HTML tag, e.g. foo →<foo></foo>
.
Initial release of django-template-snippets.
Add more template tags, change syntax and update README.md with cheat sheet.