[Distutils] setuptools and additional scripts handling

Raphael Ritz r.ritz at biologie.hu-berlin.de
Wed Feb 17 16:12:46 CET 2010

Manlio Perillo wrote:

> However, for my web application there is more work to do.
> I use Nginx + wsgi module, so I also need to configure Nginx.
> The Nginx configuration file is actually a Mako template, since some
> parameters (server name, location paths) depends on the deployment type
> (development PC, testing server, production server).

Again, if that's your use case I encourage you to look into
using buildout. At least I use it myself in situations that seem
similar to yours and I'm happy with it (thanks Jim!).

One of the many nice things about buildout configuration files
is that you can quite flexibly mix-and-match, meaning you can
have a 'base.cfg' which is then extended by other more specific
cfg files, etc. And it is very easy to selective overwrite individual
settings from those more specialized ones.

In case you want to explore that option, here a few more pointers:

buildout: http://pypi.python.org/pypi/zc.buildout

nginx: http://pypi.python.org/pypi/gocept.nginx

A non-trivial example explicitly spelled out:
(some but not all parts in there are Zope/Plone specific
but still it should help getting the big picture)

which points to cfgs in

would be another example illustrating a multi-platform,
development-and-production setup. See in particular
for more.

The last example sets up the Zope server clients to run under
'paster' with a WSGI pipeline.

Again, I'm not suggesting to use Plone here but I happen to know
that stuff ;-) and I think the examples illustrate nicely how
one can use buildout to manage somewhat complex systems quite
comfortably. (and I know some people are doing way more crazy
things with it ...)



> These parameters are defined in a configuration file, and during setup
> the configuration file needs to be generated.
> Should this be done subclassing the config command?
>>> Raphael
> Manlio
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 3bgAn0yXdNn8kI92IhPxxI4AE6NHeINR
> =aZvH
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

More information about the Distutils-SIG mailing list