I have no idea why are you writing this code  by yourself ?
 This  is already done  !
 Take a look at
https://github.com/django/django/blob/master/django/contrib/auth/views.py

 login function is already done  and you can  use it .  Have no sense
to write it by yourself.
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Mon, Oct 14, 2013 at 3:52 PM, Hanne Moa <hanne....@gmail.com> wrote:
> I can't get logging in with alternate auth backends to work with Django 1.4
> or newer.
>
> Basically:
>
> 1. authenticate() works. request.user.is_authenticated() is True
> 2. Django's own login() seems to work, as request.user is set,
> request.session is set etc.
> 3. After the HttpResponseRedirect, request.user is AnonymousUser
>
> This has happened twice now, with different alternate auth backends. I can't
> get rid of Django 1.3 before this is fixed...
>
> In one project I can call the next view directly (with render) and it Just
> Works. In the current project, the next view contains a form, and the
> "login" doesn't survive the POST.
>
> What am I missing? See also the non-solution in
> http://stackoverflow.com/questions/16119155/django-request-user-not-set-after-redirect
>
>
> HM
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/CACQ%3DrreSearLz5zZyu1yZWnAx_CrSOW7u0f%3DnPdVHMMOX4DOhQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CADTRxJO%2BwGM0GtyECQiNEAQFJq-nqSQEn5vefPGU6oJx%3DJS8PA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to