On 24/04/2019 8:05 am, meliodis live wrote:
> Yes
I would instrument the code below with print statements to identify
where it is going off the rails.
>
> On Wed, 24 Apr 2019, 3:04 am Mike Dewhirst <miked@dewhirst.com.au
> <mailto:miked@dewhirst.com.au> wrote:
>
> On 24/04/2019 4:39 am, irtazahussain999@gmail.com
> <mailto:irtazahussain999@gmail.com> wrote:
> > I am using authenticate function to authenticate user on login
> this is
> > working properly but only allow superuser to login.
>
> Are your other users active?
>
> >
> > def Login_View(request):
> >
> > if request.method == "POST":
> >
> > username = request.POST['username']
> >
> > password = request.POST['pwd']
> >
> > user =authenticate(request,username=username,
> > password=password)
> >
> > if user is not None:
> >
> > if user.is_active:
> >
> > login(request, user)
> >
> > name =
> User.objects.get(username=request.user)
> >
> > request.session['username'] = username
> >
> > return redirect('/dashboard/',{'name':name.username})
> >
> > # return
> > render(request,'dashboard_app/index.html',{'name':name.username})
> >
> > else:
> >
> > return render(request, 'login_app/index.html',
> > {'error_message': 'Your account has been disabled'})
> >
> > else:
> >
> > return render(request, 'login_app/index.html',
> > {'error_message': 'Invalid login'})
> >
> > return render(request, 'login_app/index.html')
> >
> > kindly aolve my issue asap
> >
> > --
> > 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
> <mailto:django-users%2Bunsubscribe@googlegroups.com>
> > <mailto:django-users+unsubscribe@googlegroups.com
> <mailto:django-users%2Bunsubscribe@googlegroups.com>>.
> > To post to this group, send email to
> django-users@googlegroups.com <mailto:django-users@googlegroups.com>
> > <mailto:django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>>.
> > Visit this group at https://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/af4b7e96-eb62-4d56-988e-7eb4140f0a77%40googlegroups.com
>
> >
> <https://groups.google.com/d/msgid/django-users/af4b7e96-eb62-4d56-988e-7eb4140f0a77%40googlegroups.com?utm_medium=email&utm_source=footer>.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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
> <mailto:django-users%2Bunsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dc989d82-dcd3-658d-0761-990eababec61%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto:django-users@googlegroups.com>.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMiRa0KR9M9OXYJNdOt01QNiWzM3zyR_5bYvx3Ryi8wjfFmMNQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMiRa0KR9M9OXYJNdOt01QNiWzM3zyR_5bYvx3Ryi8wjfFmMNQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ff55449e-cab2-6e44-c56a-e630b1c79554%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment