Ad

Using 'form' In 'login.html' I Got This Error Message. 'url' Requires A Non-empty First Argument

- 1 answer

NoReverseMatch at /accounts/login/ 'url' requires a non-empty first argument. The syntax changed in Django 1.5, see the docs. And the code where error is being shown in 'login.html', is

<form method="post"  action="{% url django.contrib.auth.views.login %}">
Ad

Answer

Add the quotes around the name of your url:

{% url 'django.contrib.auth.views.login' %}
Ad
source: stackoverflow.com
Ad