Sorry I forget to send you a reference link

https://docs.djangoproject.com/en/1.7/topics/auth/default/#django.contrib.auth.login

2015-04-04 17:00 GMT-06:00 Luis Zárate <[email protected]>:

> It's because you need to login the user (authenticate don't login only get
> the user )
>
> It's something like this:
>
> from django.contrib.auth import authenticate, login
> def my_view(request):
>     username = request.POST['username']
>     password = request.POST['password']
>     user = authenticate(username=username, password=password)
>     if user is not None:
>         if user.is_active:
>             login(request, user)
>             # Redirect to a success page.
>         else:
>             # Return a 'disabled account' error message
>             ...
>     else:
>         # Return an 'invalid login' error message.
>         ...
>
>
>
> 2015-03-30 3:46 GMT-06:00 aRkadeFR <[email protected]>:
>
>  Hello,
>>
>>
>> Just by changing the type of your input, you're enable to
>> authenticate inside your view then?
>>
>> Do a dump of your post data to see if anything has changed.
>> ```
>> print("data: {!s}".format(request.POST))
>> ```
>>
>> Then you can see in a shell (manage.py shell) if the authenticate
>> function works as expected with your data.
>>
>>
>> On 03/28/2015 10:36 AM, Kishan Mehta wrote:
>>
>> Hi all,
>>
>> >>My html has following input type :
>>
>> Password: <input type="password" name="password" value="" size="50" />
>>
>>
>> >>  user = authenticate(username=username, password=password)
>> is not able to authenticate in views.py...
>>
>> Not able to login.
>>
>> P.S :
>> when i do :
>>
>> <input type="text"  ....
>>
>> authentication works...
>>
>> Please help.
>> New to django.
>>  --
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/9b40bc4f-09ad-4697-b2a7-5d4881acd496%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9b40bc4f-09ad-4697-b2a7-5d4881acd496%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].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/55191B65.4040804%40arkade.info
>> <https://groups.google.com/d/msgid/django-users/55191B65.4040804%40arkade.info?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyM89dDpXzmsDwy2w85T0S1pnWhj3rOAA33vqqu0K%3DaKGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to