Django - Reversing admin URLs in Templates

{% raw %}
{% url admin:index %}
{% url admin:polls_choice_add %}
{% url admin:polls_choice_change choice.id %}

# For Django 1.5. Thanks to Kenneth Love
{% url 'admin:index' %}
{% url 'admin:polls_choice_add' %}
{% url 'admin:polls_choice_change' choice.id %}
{% endraw %}

With this Code Examples you can manage to get the right url in the templates where you want.

  1. Is the index url of the admin.

  2. Is the add url for the App Polls with the Model Choice.

  3. Is the change url for the App Polls with the Model Choice and with Parameter for that object what you want to change.

The principe is {{ app_label }}_{{ model_name }}_change object_id

This help me today a lot at work.

For you interest:

Django Docs:Reversing Admin Urls Kenneth Love

Comments !