On Sep 26, 2012, at 1:45 PM, Zak <zakdan...@gmail.com>
wrote:
> So if you can run custom scripts beforehand with a runapp.py file, then what exactly does the "pserve development.ini" command do? Does it just start running everything with default settings?
yeah more or less. It uses the classic paste defaults (app:main, server:main, etc) and gives you some interpolation options. At it's core, it's doing roughly the same thing… calling loadapp and then handing the result to a server you've defined in your ini.
The compromise (perhaps virtuous), is that you can do any computation in the ini. pserve does give you interpolation so you could accomplish the same thing by something like this::
in your ini:
```
workers=%(workers)s
```
on the cmdline:
$ pserve dev.ini workers=`python -c 'import multiprocessing as m; print m.cpu_count() * 2 + 1`
But at that point (or close to it), might as well write a runner…
in general pserve offers some conveniences like the reload flag and allows for a generalized way for running an app from **solely** an ini file.
The philosophy behind paste and paste script (ala paster from which pserve is derived) is to give operations people a unified interface for running wsgi applications whereas as custom runners may be unpredictably heterogenous as the people who wrote them.
opinions stated here are my own… Chris and others might have more correct or nuance opinions.
-w