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
                else:
                        return render_to_response('myapp/login.html')
        else:
                return render_to_response('myapp/login.html')

In login template for I am using the hidden field 'next'

...
<input type="submit" value="login" />
        <input type="hidden" name="next" value="{{next|escape}}" />

I have given the LOGIN_URL as '/myapp/login/and in urlconf  set this
to the above login_view method .
url(r'^','myapp.views.login_view',name='myapp_login'),

Also I have many views to list the entries belonging to an year,month
etc..All of them have @login_required .
eg:
@login_required
def entry_archive_year(request,year,month):
        ....
        return render_to_response('myapp/archive_month.html',somedict)


Now if I try to access /myapp/entries/1999/jan/ ,I will get the login
page .The url on browser search field is /myapp/login/?next=/myapp/
entries/1999/jan/.If I login correctly ,I would like the page to go
to /entries/1999/jan/  and not to the 'myapp_archive_index' page I
provided in the login_view method.Is there a way to redirect to the
value pointed to by this  'next'?

thanks
harry

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

Reply via email to