Scott Moonen wrote:
> Ganesh,
>
> First ensure that your TEMPLATE_CONTEXT_PROCESSORS contains:
>
> TEMPLATE_CONTEXT_PROCESSORS = (
> . . .
> 'django.core.context_processors.request',
> . . .
> )
>
> Then you can use the variable {{ request.path }} in your templates,
> assuming that the URLs are all on the same host. If not, you'll need
> to use something like {{ request.META.HTTP_HOST }}://{{ request.path }}.
>
> -- Scott
>
>
> On Fri, May 16, 2008 at 12:58 PM, M.Ganesh <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
> Hi,
>
> I don't know how to clearly explain what I want to know. Let me
> try once
> again...
>
> I have a small controlpanel page which I include in all my other
> pages.
> This control panel page has got a link to 'login' page. Users are
> allowed to view the pages without login, but they have to login if
> they
> want to make any changes to the data. So if somebody realises he wants
> to change the data he is currently viewing, he will click the login
> link. Now I want him to be brought back to the page he was viewing
> before logging in. The trouble is because the 'login' link is in a
> template which will get included to a arbitrary page. In other words :
>
> #my controlpane.html
>
> {% if user.is_anonymous %}
> <p align="center">Welcome <br>
> Please login<br><br>
> <a href='/login/?next={{ WHAT-DO-I-PUT-HERE }}'>login</a></p>
> {% else %}
> blah blah
> {% endif %}
>
>
> Regards Ganesh
>
Hi Alex and Scott,
That worked like a charm. Thanks a ton.
My next task is to use this path to redirect. I'll get back if need more
help
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
-~----------~----~----~----~------~----~------~--~---