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
>>
>>
>>
>
> --
> Adi J. Sieker         mobile: +49 - 178 - 88 5 88 13
> Freelance developer   skype:  adijsieker
> SAP-Consultant        web:    http://www.sieker.info/profile
>                       openbc: https://www.openbc.com/hp/AdiJoerg_Sieker/
>
>
>
>
> >

--
Adi J. Sieker         mobile: +49 - 178 - 88 5 88 13
Freelance developer   skype:  adijsieker
SAP-Consultant        web:    http://www.sieker.info/profile
                       openbc: https://www.openbc.com/hp/ 
AdiJoerg_Sieker/




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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