Thank's I have it!

W dniu środa, 4 listopada 2015 06:51:02 UTC+1 użytkownik Dariusz Mysior 
napisał:
>
> I try do login view and I find it on 
>
> https://docs.djangoproject.com/en/1.8/topics/auth/default/
>
> 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.
>         ...
>
>
>
> to give request.POST username and password and username I must create my 
> own form or maybe Django have that form ready? I use Django 1.8
>

-- 
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/e8038d21-9ad5-4e52-b5af-c9fa78f44681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to