我需要Django的一些幫助1.8DJANGO PYTHON:NoReverseMatch at:反轉'views.login'參數'()'和關鍵字參數'{}'未找到。 0模式(S)嘗試:[]
錯誤:
異常類型:NoReverseMatch
異常值:反轉與參數 'views.login'' ()'和關鍵字參數'{}'找不到。 0圖案(多個)嘗試:[]
urls.py
urlpatterns = [
url(r"^login/$", TemplateView.as_view(template_name = 'auth/login.html'))
]
的login.html
<html>
<body>
<!-- action = "{% url 'connecte_login' %}" -->
<form name = "form" action = "{% url 'views.login' %}" method = "POST" >
{% csrf_token %}
<div style = "max-width:470px;">
<center>
<h5> <font color="blue">KEYSTONE AUTHENTIFICATION </font> </h5>
<b>Username :</b> <input type = "text" style = "margin-left:7%;"
placeholder = "Identifiant" name = "username" />
</center>
</div>
</form>
</body>
</html>
views.py
from django.shortcuts import render,redirect
from .forms import *
def login(request):
return render(request, "auth/authSuccess.html", context_dic)
authSuccess.html
<html>
<body> <b>IT WORKS !</b> </body>
</html>
我不知道爲什麼它給了我那個錯誤!
謝謝。
在相關部分右側至少有10個重複問題。請先嚐試自己解決問題。 – Sayse
可能重複的[django反向錯誤NoReverseMatch](http://stackoverflow.com/questions/7378323/django-reverse-error-noreversematch) – Sayse
我看到他們,但它沒有幫助我:( –