[Solved]-Refer to admin site using {% url 'admin' %} in app django

33👍

Try reversing the URL using admin namespace

{% url 'admin:index' %}

Refs: Django docs

0👍

You don’t need to add a custom name on admin.site.urls as it already exists.
As Arpit Solanki suggested, try reversing the URL using admin namespace

{% url 'admin:index' %}
For the other URLs (with names) see django/contrib/admin/sites.py file in the Django package or reversing-admin-urls

Leave a comment