[Fixed]-Anchor Links from One Page to Another in Django

1👍

you can use

{% for listing in listings %}
  <div class="featured-block">
    ...
    <p style="font-weight: bold">For more information please contact {{ user.first_name }} {{ user.last_name }} at {{ listing.phone }}.<a href="{% url 'listing_list' listing.id %}">{{listing.id}}</a></p>
  </div>
{% endfor %} 

The url template tag

{% url 'listing_list' listing.id %}

will generate the url for the id refer docs and

{{listing.id}}

will show the id on the html

Leave a comment