How would you get the current url location?
I've tried to build the current url using request.env.http_host +
request.env.path_info, but it doesn't take into account routes.py.
For example using that method returns 127.0.0.1:8000/init/default/
contact, but I want it to return
On May 5, 2010, at 12:16 PM, Chris wrote:
How would you get the current url location?
Generally speaking, you want to use URL(r=request, args=request.args,
vars=request.vars), or something like that (I may not have all the spelling
right).
That will not include the host part of the URL,
That works. Thank you
On May 5, 3:27 pm, Jonathan Lundell jlund...@pobox.com wrote:
On May 5, 2010, at 12:16 PM, Chris wrote:
How would you get thecurrenturllocation?
Generally speaking, you want to use URL(r=request, args=request.args,
vars=request.vars), or something like that (I may
I'm not sure if it's reliable or safe but request.env.http_referer
might be what you're looking for.
On May 3, 4:39 pm, Miguel Lopes mig.e.lo...@gmail.com wrote:
Is there a way to find the previous location / address in an action?
For example:
Currently inwww.domain.com/a/c/f/arg1
Follow
request.env.http_referer is not working for me.
I checked (http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14) and the
referer is optionally set by the client. So we can not take it for granted.
Miguel
On Mon, May 3, 2010 at 10:45 PM, mr.freeze nat...@freezable.com wrote:
I'm not sure if
web2py probably isn't setting referer on a redirect, and if it did, you'd
have to interpret the URL.
How about putting the previous location in session before you redirect?
On Mon, May 3, 2010 at 3:05 PM, Miguel Lopes mig.e.lo...@gmail.com wrote:
request.env.http_referer is not working for me.
On Mon, May 3, 2010 at 11:08 PM, Jonathan Lundell jlund...@pobox.comwrote:
web2py probably isn't setting referer on a redirect, and if it did, you'd
have to interpret the URL.
No. If I have no redirect and call a location with no args the referer is
not set when I arrive at web2py's default
On Mon, May 3, 2010 at 11:08 PM, Jonathan Lundell jlund...@pobox.com wrote:
web2py probably isn't setting referer on a redirect, and if it did, you'd
have to interpret the URL.
No. If I have no redirect and call a location with no args the referer is not
set when I arrive at web2py's
8 matches
Mail list logo