NoReverseMatch Error

Dean picture Dean · Feb 12, 2011 · Viewed 45.4k times · Source

I keep getting this error for the django login system. Here is part of my urls.py:

     (r'^contractManagement/login', 'django.contrib.auth.views.login', {'template_name': 'login.html'}),

The exact error I am getting:

Exception Type: NoReverseMatch
Exception Value:    Reverse for ''django.contrib.auth.views.login'' with arguments '()' and keyword arguments '{}' not found.

I can't understand why i am getting this error. If you need anything else let me know.

Answer

Daniel Roseman picture Daniel Roseman · Feb 12, 2011

You don't show where you are trying to reverse this URL, but it looks like you have double-quoted it. If you're using the url tag, note that you don't need quotes around the url name:

{% url django.contrib.auth.views.login %}

not

{% url 'django.contrib.auth.views.login' %}