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>Set admin url in your project urls.py, same folder as your settings.py</p>

<pre><code>Url(r'^admin/', admin.site.urls),
</code></pre>

<p>Then call it in your template:</p>

<p><code>&lt;a href="{% url 'admin:index' %} &gt; link &lt;/a&gt;</code></p>

python django