Resolved!

When I did

*$ python setup.py develop*

to install the required packages into the environment a new line was added
in *easy-install.pth*

*/path/to/app1/*

So every app using that environment (app1, app2) share that path, and
conflicts came up.

León Domingo

*ender*
*LA FACTORÍA DE SOFTWARE*

Av. Cerro del Águila 7, 2ª planta - S23
28703 S.S. de los Reyes
Madrid

tlf. y fax: 902 01 44 01
*www.ender.es*


On 14 July 2011 10:43, León Domingo <[email protected]> wrote:

> Hi,
> I'm deploying several apps with Apache2+modwsgi method. These apps
> have a hack in AppConfig in order to solve some Jinja2 related
> problems (I got this patch from Carlos Daniel R.). AppConfig is simply
> inherited and modified. The thing is that in the "setup_routes" method
> I added some code to control the "root" I want for an app. I define a
> parameter in the ".ini" file that tells where is that root:
>
>        # Setup a default route for the root of object dispatch
>        controller_ = 'root'
>        root_folder = config.get('app.root_folder')
>        if root_folder:
>            controller_ = '%s/root' % root_folder
>
>        map.connect('*url', controller=controller_,
> action='routes_placeholder')
>
> File tree is something like:
>  ...
>  controllers/
>        appX/
>            root.py
>            # other controllers (particular funcionality)
>        root.py # this controller defines general functionality
>
> Then I define
>
> # .ini for app1
> app.root_folder = app1
>
> # .ini for app2
> app.root_folder = app2
>
> My problem is that app2 doesn't get this correctly. I mean, when I try
> to access the web in the second app (app2) I get an error:
>
>        ImportError: No module named app2.root
>
> **I'm guessing that somehow the AppConfig code is executed only once,
> so the second app is running with an already loaded code, or
> something.**
>
> Furhermore, if I comment "app.root_folder" parameter in the second app
> (that means that default "root" would be used instead) it works, but I
> lose the particular root that I defined for "app2".
>
> Thanks
>
> León Domingo
>

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

Reply via email to