NoReverseMatch in Django 1.10
<p>Here is my <strong>url.py</strong></p>

<pre><code>from django.conf.urls import url
from django.contrib import admin
from app import views, auth
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', views.index, name = 'index'),
    url(r'^login/', auth.login, name = 'login'),
    url(r'^logout/', auth.logout, name = 'logout'),
]
</code></pre>

<p>When I'm using in template <code>&lt;li&gt;&lt;a href="{% url 'admin' %}"&gt;Administration&lt;/a&gt;&lt;/li&gt;</code> get error</p>

<pre><code>NoReverseMatch at /
Reverse for 'admin' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
</code></pre>

<p>So can any one tell me how to solve this? Thank you very much.</p>

<p>Use <code>admin:index</code> if you want to have an url to <code>/admin/</code> site.
If you install <a href="https://pypi.python.org/pypi/django-extensions/0.7.1" rel="nofollow">django-extensions</a> you can use <code>./manage.py show_urls</code> to get the list of urls for your app</p>

python django