Django do have built-in forms. Take a look here
https://docs.djangoproject.com/en/1.8/topics/auth/default/#module-django.contrib.auth.forms

On Wed, 4 Nov 2015 at 11:21 Dariusz Mysior <[email protected]> wrote:

> 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/96258668-1c56-45d6-adce-59cff591dd23%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/96258668-1c56-45d6-adce-59cff591dd23%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/CAByqUghm8bf_MF-rh9%2BjN6XfobF3Gtrz%3Dstswswkb1Lh12%2BV%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to