On Tue, Feb 9, 2010 at 3:47 PM, harryos <[email protected]> wrote:
> hi
> In my login_view I am redirecting to an archive page as below
>
> def login_view(request):
>        if request.method=='POST':
>                username=request.POST['username']
>                password=request.POST['password']
>                user = authenticate(username=username, password=password)
>                if user is not None and user.is_active:
>                        login(request, user)
-                        return redirect('myapp_archive_index')#default page
+                       return
HttpResponseRedirect(request.POST.get('next',
reverse('myapp_archive_index'))
>                else:
>                        return render_to_response('myapp/login.html')
>        else:
>                return render_to_response('myapp/login.html')
>
..
> Is there a way to redirect to the
> value pointed to by this  'next'?
>
> thanks
> harry
>

HTH

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to