Hash :
8c3fa000
Author :
Date :
2018-03-01T23:51:10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<h1>Django/Jinja2</h1>
<p>To use this language, use one of the following classes:</p>
<ul>
<li>"language-django"</li>
<li>"language-jinja2"</li>
</ul>
<h2>Comment</h2>
<pre><code>{# This is a comment #}</code></pre>
<h2>Variable</h2>
<pre><code>{{ some_variable }}</code></pre>
<h2>Template Tag</h2>
<pre><code>{% if some_condition %}
Conditional block
{% endif %}
</code></pre>
<h2>Full Example</h2>
<pre><code>{# This a Django template example #}
{% extends "base_generic.html" %}
{% block title %}{{ section.title }}{% endblock %}
{% block content %}
<h1>{{ section.title }}</h1>
{% for story in story_list %}
<h2>
<a href="{{ story.get_absolute_url }}">
{{ story.headline|upper }}
</a>
</h2>
<p>{{ story.tease|truncatewords:"100" }}</p>
{% endfor %}
{% endblock %}
</code></pre>