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.