126👍
Try what Oggy is suggesting but then use ‘:’ instead of ‘_’ with the current Django:
<a href="{% url 'admin:index' %}">link to admin panel</a>
8👍
Which django version are you using? If you’re using trunk, change your admin urlpatterns from:
(r'^admin/(.*)', admin.site.root)
to:
('^admin/', include(admin.site.urls))
And then you get a named URL pattern called ‘admin_index’ which you can refer to. See
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#reversing-admin-urls
for more information
👤oggy
- [Django]-Getting a count of objects in a queryset in Django
- [Django]-Get count of related model efficiently in Django
- [Django]-How to use MySQLdb with Python and Django in OSX 10.6?
Source:stackexchange.com