smilebomb
smilebomb

Reputation: 5483

django link to a specific admin view

Let's say I have this url: localhost/admin/app_name/model_name/. How can I link to this inside my template?

I have already linked the admin page like so

<a href="{% url 'admin:index' %}">Admin</a>

Is there a variant of this I should use?

I'm using 1.5.2

Upvotes: 2

Views: 370

Answers (1)

falsetru
falsetru

Reputation: 369074

You can reverse admin list page url as follow:

{% url 'admin:app_model_changelist' %}

For other admin pages, see Reversing admin URLs from Django documentation.

Upvotes: 3

Related Questions