config("proxied_name") => name seen through the reverse proxy
config("proxied_dir") => dir (if needed) that the reverse proxy
happens to your url.
def presentable_url(relative_url):
from tg import config
return basejoin( config.get( "proxied_host" , abs_url("/" )),
"/".join( [ config.get("proxied_dir","") , relative_url ] ))
2011/9/27 León Domingo <[email protected]>:
> Hi,
> Is there any way to get absolute URLs? Something that builds the url
> depending on the domain and the actual URI for a resource? For my
> development machine it'd be something like http://localhost/foo/bar,
> for tg.url('/foo/bar'), but the same thing in production would be
> http://someclient.domain.com/foo/bar.
>
> When I use tg.url('....') in my templates everything's ok when this
> templates are shown on the browser, but there are cases when I need
> the absolute URLs for css, images, etc, something that browsers do
> when a relative URL is encountered.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" 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/turbogears?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.