[Answer]-Django HTML-how to make the title of an object 'clickable' and direct to detail display page after clicking

1👍

The usual way I approach this in Django is to implement the get_absolute_url() function for the particular model class, i.e. Book in your case.

Resulting template code would be:

{% for b in book %}
<li>
    <a href="{{ b.get_absolute_url }}">{{ b.title }}</a>
</li>
{% endfor %}   

Leave a comment