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):
> user
Looks like you are not making anything very custom on you view so maybe
would be easier/better to use the buitin views from django auth.
on your urls.py you can do:
from django.contrib.auth import views as auth_views
urlpatterns = [
...
url(r'^login/', auth_views.login),
]
On your sett
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 wrote:
> I try do login view and I find it on
>
> https://docs.djangoproject.com/en/1.8/topics/auth/default/
>
>
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, pa
4 matches
Mail list logo