On Jun 25, 12:19 pm, Marius Gedminas <[email protected]> wrote:
> On Thu, Jun 25, 2009 at 05:22:24AM -0700, Thomas G. Willis wrote:
> > ok, I've been trying to figure this out for a while, and I haven't
> > quite cracked this nut.
>
> > What I'm trying to do is understand the mechanics of mounting a pylons
> > app as anothers controller. To get this sort of effect...
>
> >http://myapp:5000/home/index<------site container
> > and
> >http://myapp:5000/registration/register/index<---- another pylons app
>
> > in my registration.py controller of my container app I have...
>
> > from paste.deploy import loadapp
> > RegistrationController = loadapp("config:/path/to/config.ini")
>
> > in my routing.py of my container app I have...
>
> > map.connect("registration/{path_info:.*}",controller="registration")
>
> I don't think you can chain routes this way.

Would  you mind elaborating? It seems it should work. Doesn't routes
just pick up the SCRIPT_NAME and PATH_INFO from environ? And isn't the
purpose of the above map.connect to set those 2 variables
appropriately? What's the magic I'm missing?

> Use something like Paste's urlmap instead.  See the example 
> athttp://pythonpaste.org/deploy/#the-config-file
>
> Marius Gedminas
> --

Would using urlmap allow the contained app to access info in the
middleware stack? like repoze.who and repoze.what things? ie:
contained app can tell if there's a user coming from the container
app?

It seems what you are saying may be contradictory to what it says in
the book.

http://pylonsbook.com/en/1.0/the-web-server-gateway-interface-wsgi.html#wsgi-in-pylons-controllers

"Being able to mount WSGI applications as Pylons controllers is very
useful because it gives you the basis for integrating Pylons
applications with third-party WSGI-enabled software such as MoinMoin
or Mercurial. As an example, it is perfectly possible to mount an
entire Trac instance as a Pylons controller. This has the benefit that
Trac will be able to use the same authentication and authorization
system that you are using with Pylons and will also benefit from
Pylons’ automatic error documents and interactive debugger."

It seems like a caveat is missing. Is it more correct to say

"Being able to mount WSGI applications as Pylons controllers is very
useful because it gives you the basis for integrating Pylons
applications with third-party WSGI-enabled software such as MoinMoin
or Mercurial but NOT another pylons app" ?

maybe not, which is why I'm trying to understand why this doesn't
work, or why it's so difficult.


--~--~---------~--~----~------------~-------~--~----~
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