thanks.

for the record; locally on a Win XP box and deployed to GAE the
following works:

'http://%s%s' % (request.env.http_host, URL(r=request,c='c', f='f'))

[odd behaviour from Google Groups - I couldn't find this thread in
search results and had to retrieve from browser history]

On Jun 17, 6:25 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> This is not possible in general because web2py may be behind a proxy.
>
> You can make a guess:
>
> '%s://%s:%s % (request.env.request_methd, request.env.http_host,
> request.env.server_port)
>
> and it is not guaranteed that the server defines these variables
> either.
>
> massimo
>
> On Jun 17, 12:04 pm, Carl <carl.ro...@gmail.com> wrote:
>
>
>
> > I'm building URLs for emails.
>
> > One email is fired out in response to the user submitting a form.
>
> > url = '%s%s' % (request.env.http_origin,URL
> > (r=request,c='default',f='confirmgreet', args=base64.b16encode
> > (address)))
>
> > However, I also need to build an URL when a form is not submitted.
> > In this case, no request.env.http_origin is defined
>
> > How can I find out what thehttp://site/pathis so that my code can
> > run regardless of deployment (local or GAE).
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to