In last tutorial, we create a list in python file and display it on our webpage. But it doesn't make sense. If you want to get each programming language in it, here are some tips.
For Loop in Django Template
- Open "news.html", and add these codes below
{{ list }}
. You will find the syntax is similar to what we used in python.
{% for language in list %}
<ul>
<li>{{language}}</li>
</ul>
{% endfor %}
-
Refresh launched page, you will see update.