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 <[email protected] <mailto:[email protected]> wrote:

    On 24/04/2019 4:39 am, [email protected]
    <mailto:[email protected]> 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 [email protected]
    <mailto:django-users%[email protected]>
    > <mailto:[email protected]
    <mailto:django-users%[email protected]>>.
    > To post to this group, send email to
    [email protected] <mailto:[email protected]>
    > <mailto:[email protected]
    <mailto:[email protected]>>.
    > 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 [email protected]
    <mailto:django-users%[email protected]>.
    To post to this group, send email to [email protected]
    <mailto:[email protected]>.
    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 [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
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 [email protected].
To post to this group, send email to [email protected].
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.

Reply via email to