Thanks. 

For now, I might just reassign an existing base-url-variable in the 
exception handler.

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)?

Thanks.


On Friday, September 14, 2012 4:17:50 PM UTC-7, Alessandro Molina wrote:
>
> As tg.url generates urls using the HTTP request that is serving to 
> retrieve things like the domain and where the app is mounted it is 
> actually not possible to call it outside a request. 
>
> You should probably write somewhere the domain which the links you are 
> generating should point to and make urls from that one using something 
> like: '?'.join((mydomain, urllib.urlencode(params)) 
>
> On Sat, Sep 15, 2012 at 12:03 AM, ozwyzard <[email protected]<javascript:>> 
> wrote: 
> > I have a scenario where I need to kick start app tasks (e.g. send 
> reminded 
> > email with URLs in it) upon re-start of a TG app.  The stale tasks need 
> the 
> > tg.url in the context.  I also have a "pure" tgscheduler instance that I 
> > start when the app starts.  I cannot call the app task from the 
> tgscheduler 
> > instance since it chokes on (TypeError: No object (name: url) has been 
> > registered for this thread).  Further searching tells me that request 
> > context is not setup in my pure tgscheduler instance. 
> > 
> > Question:  Should I schedule bootup tasks in/around make_app() ? 
> > 
> > Thanks. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "TurboGears" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/turbogears/-/ZRsYIyTtRrMJ. 
> > To post to this group, send email to 
> > [email protected]<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:>. 
> > 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 view this discussion on the web visit 
https://groups.google.com/d/msg/turbogears/-/OeAi2bjbBwUJ.
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.

Reply via email to