Add part 4e, higher-level URLs in templates

parent 43cb587e
......@@ -105,3 +105,5 @@ Create `urlapp/templates/index.html` and `urlapp/templates/details.html`.
Add 404.
Edit `urlapp/views.py`.
Higher-level URLs.
Edit `urlapp/templates/index.html`.
......@@ -4,8 +4,8 @@
<ul>
{% for u in url_list %}
<li>
<a href="/url={{ u.id }}/">Show details</a>, or follow
<a href="/{{ u.id }}/" target="_blank"><code>{{ u.target }}</code></a>
<a href="{% url 'url' u.id %}">Show details</a>, or follow
<a href="{% url 'redir' u.id %}" target="_blank"><code>{{ u.target }}</code></a>
</li>
{% endfor %}
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment