Thursday, September 29, 2022

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

change your function name, if you imported login and named your function like as login it will give a conflict


On Fri, Sep 30, 2022 at 9:25 AM Sivadev siva <sivadevsiva05@gmail.com> wrote:
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

--
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+unsubscribe@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.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJwZndeDrL2n%3Db_fLouYf5_qjrWV4nZfckzOh3gBwJbyiCvNwA%40mail.gmail.com.

No comments:

Post a Comment