NoReverseMatch at /credentials/login/ Reverse for 'login' not found. 'login' is not a valid view function or pattern name.

44 views
Skip to first unread message

Sivadev siva

unread,
Sep 30, 2022, 12:24:18 AM9/30/22
to Django users
how can i solve this

Sivadev siva

unread,
Sep 30, 2022, 12:25:19 AM9/30/22
to Django users
def login(request):
if request.method=='POST':
username=request.POST['user']
password=request.POST['pd']
user=auth.authenticate(username=username,password=password)
if user is not None:
auth.login(request,user)
return render(request,"newpage.html")
else:
messages.info(request,"INVALID CREDENTIALS")
return redirect('login')
return render(request,"login.html")


On Friday, September 30, 2022 at 9:54:18 AM UTC+5:30 Sivadev siva wrote:
how can i solve this

Mohammad Ehsan Ansari

unread,
Sep 30, 2022, 12:28:14 AM9/30/22
to django...@googlegroups.com
check your url pattern 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8bb76f58-6cec-48aa-ad8d-220d384c5a68n%40googlegroups.com.

Chelsea Fan

unread,
Sep 30, 2022, 1:08:30 AM9/30/22
to django...@googlegroups.com
change your function name, if you imported login and named your function like as login it will give a conflict


--

subin

unread,
Oct 2, 2022, 4:08:56 PM10/2/22
to django...@googlegroups.com

subin

unread,
Oct 2, 2022, 4:09:29 PM10/2/22
to django...@googlegroups.com
Thanks again for all your help.

subin

unread,
Oct 2, 2022, 4:10:16 PM10/2/22
to django...@googlegroups.com
Season’s greetings! Our offices will be closed on Dec. 24 and 25. However

--

subin

unread,
Oct 2, 2022, 4:11:07 PM10/2/22
to django...@googlegroups.com
Thanks for reaching out! This inbox is not monitored. Please call this number or email us at

On Fri, Sep 30, 2022 at 5:24 AM Sivadev siva <sivade...@gmail.com> wrote:
how can i solve this

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages