Skip to content

4.2 Django Template Language

juyaolongpaul edited this page Apr 15, 2018 · 1 revision

On the page of Start With A Single Click , you might notice a code section like this:

    {% for post in post_list %}
        <div class="post">

            <h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1>  <!-- List all the post, going to the post page when clicked-->

What does {% %} and {{}} mean? The syntax is called Django template language, and the detailed tutorial is here.

Clone this wiki locally