Advice on distutils and distribution policies

Mardy mardy at users.sourceforge.net
Mon Nov 21 18:36:52 EST 2005


Hi Magnus,
  thanks a lot for your posting, you made me clear several things.
However, there something I still want to discuss:

Le die Mon, 21 Nov 2005 20:08:24 +0100, Magnus Lycka ha scribite:
[...]
> In an apache cgi-bin directory: The main Python CGI script(s) that are
> called by the web server. These might be scripts that are modified as a
> part of the installation process to e.g. point out data files. These
> should be short files. Import a module, set up configuration and run
> something in the imported module.

Good point!

> Under /usr/lib/python2.x/site-packages/ you keep the bulk of your
> software (as described above).
> 
> HTML and CSS files that are to be handled directly by the web browser is
> placed under Apache's DOCUMENT_ROOT etc. E.g. $DOCUMENT_ROOT/eligante.

Actually, for the moment, this is just the CSS file.

> Data files that are read and processed by you own programs (i.e. not
> directly by the web server) van be anywhere under /var, e.g.
> /var/eligante.

And this is the HTML one (which is a template that is used by the python
scripts).
The number of HTML might even grow in the future, but it's extremely
unlikely they'll be ever more than 5.

I'm even thinking of including the HTML in a python file, that will save
me the trouble of storing it elsewhere.
The other files accessed by the webserver will be the CSS and eventually
some images (and the favicon). For these I'll follow your advice of
storing them under DOCUMENT_ROOT.
This variable, though, seems to be defined only in the processes spawned
by the webserver; so my guess is that I'll have to instruct the setup.py
script to ask the user where his webserver's document root is (either
interactively, or from the command line when invoking the setup script).
I guess this involves subclassing some Distutils class, does anyone have a
starter for this?
Thanks again for your help,
  Alberto

-- 
Saluti,
    Mardy
http://interlingua.altervista.org




More information about the Python-list mailing list