Adi Jörg Sieker wrote:
> Hi,
> On 12.05.2008, at 22:07, Adi Jörg Sieker wrote:
>
>> but the idea is the same.
>>
>> def login_view(request, next_url_from_page):
> this might need to be a default parameter like:
> def login_view(request, next_url_from_page=None):
>
>> if request.method == 'POST':
>> do your login stuff
>>                 if user is logged in:
>>                return HttpResponseRedirect(request.POST['next_url'])
> typo, that should read.
> return HttpResponseRedirect(request.POST['next_url_from_form'])
>>
>> return direct_to_template(request, 'login.html', {'form': login_form, 
>> 'next_url_from_page' : next_url_from_page })
>>
>> in your login template:
>> <form>
>>
>> <input type="hidden" name="next_url_from_form" 
>> value="{{next_url_from_page}}"
>> </form
>>
>>
>> your view that needs login:
>> def view_which_needs_login(request, *args, **kwargs):
>> if user not logged in:
>>                return HttpResponseRedirect("/your_login_page?next=%s" 
>> %(request.path))
>>
>>
>>
>> I hope that helps.
>>
>> Regards
>>    Adi
>>
>>
>>
>>
>>> Regards Ganesh
Thanks Adi for your detailed reply. I'll give it a try and let you know.

Thanks for your time

Regards Ganesh


--~--~---------~--~----~------------~-------~--~----~
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