On 2009-07-27 10:46:02 AM, Toshio Kuratomi wrote:
This wsgi script also helps illustrate some of smooge's concerns
about
what happens when configuration information is mixed into a script. It
has two areas that differ between upstream's distribution and our own:
The first is bad application design but I've seen this done frequently
in PHP apps (and it sounds like Java frameworks like JBoss promote this
as well). The fact that our apps are doing it shows it can occur in any
language although we should be able to change our apps to work around it
fairly easily:
The scripts that start up our web applications under mod_wsgi all seem
to have a bit of config tweaking. Historically, this is because we
deployed with a start-app.py script that used the config file
exclusively and started as a standalone daemon. The app.wsgi script
would load the standalone daemon config file and then make some config
changes in the wsgi script before starting the application server. This
can be seen in the attached wsgi script in lines like this::
Another example of
something that could be considered mixing code and
configuration in .wsgi files is the usage of WSGI middleware (in TG1 at
least, Toshio mentioned that things might be more cleanly separated in
TG2 now). Right now, to add middleware to a TG1 application, we'd edit
the .wsgi to add code to wrap the application in middleware - it isn't
100% clear to us where this kind of change would fall from the license's
standpoint though.
Thanks,
Ricky