On Mar 17, 10:27 am, Eric Lemoine <[email protected]> wrote:
> Hello
>
> From a controller can I get a reference to the app (i.e. what's
> returned by middleware.make_app)?

Right before `return app`, you could do `app_globals.app = app` (in
fact, I think the docs for 1.0 say to do `config.app = app` anyway).

However... there's a potential issue here in that if you define
filters or a pipeline in your paste config, the app returned by
make_app will be wrapped with those other apps, so the one you saved
won't be the "root" app, which may or may not matter for your
scenario.

Having said that, it seems to me that there *must* be another way to
get at the "root" app, but I didn't dig very hard. I also ended up
rewriting the code I had that utilized `app`. I'm not sure, but it
might be a bad practice to use/need `app` in that way.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to