2

I am trying to link to the django admin in one of my templates:

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

And I get:

NoReverseMatch at /

Reverse for 'admin' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

Ok, fine; it is not called admin then. I am sorry I do not know that by heart. How is it called? Maybe I have namespaced it? How do I find this? Should I just google for that, go to the admin sources, ...? I will find it eventually, but ... Is there not an easier way? I am in debug mode!

Could I please get a list of all active URLs, with names?

blueFast
  • 41,341
  • 63
  • 198
  • 344

1 Answers1

1

You can access admin panel directly:

<a href="/admin/">admin</a>

or, using url tag and namespace admin:

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

And see the docs for reversing admin urls.

EDIT

See here a snippet to see all active urls. See entire thread for other solutions.

Community
  • 1
  • 1
doru
  • 9,022
  • 2
  • 33
  • 43
  • 2
    Thanks. That solves this particular problem, but not the general problem "how to get list of active URLs". Is this possible? – blueFast Jan 25 '16 at 21:18