[Fixed]-How to use the url template tag to point to diferrent classes within the admin

1👍

You can use:

<a href="{% url 'admin:myapp_car_changelist' %}">Cars</a>
<a href="{% url 'admin:myapp_motorbike_changelist' %}">Motorbikes</a>
<a href="{% url 'admin:myapp_truck_changelist' %}">Trucks</a>

Where myapp is the name of the app each model comes from. There’s more detail on how to reverse admin urls in the docs.

Leave a comment