On Fri, Sep 14, 2012 at 10:22 PM, ozwyzard <ozwyz...
> Ideally, I'd like tg.url to do the work of deducing the base_url of the app;
> else I'd have to deduce it programatically by rummaging through config vars
> like base_config and app_conf. I could write the base_url in a global
> variable, but if I were to use tg.url, it would require at least 1 incoming
> request. Is there a way for me to figure out the mount point without using
> tg.url (e.g. poke somewhere in pylons)?
Okay, I'm trying to catch up, so can't dig too deep for the full
answer to this right now. I can tell you that you're going to be
limited in your ability to do this the way you want.
If you go through WSGI, you'll find that a WSGIScriptAlias gets set
up. You can use that to get the relative path to the top of the web
server. However, that does still leave you with an open question: What
domain is being served up for this? So far as I can tell, WSGI doesn't
provide the domain, so you are not able to use any code to determine,
programmatically, the domain to use. That's only resolved by issuing a
request to that domain.
This can help, but you're still going to have to have something,
somewhere, to tell you the domain for the links to send out.
Michael J. Pedersen
My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen
Google Talk: m.peder...@icelus.org -- Twitter: pedersentg