Trying to understand Python web-development

Paul Boddie paul at boddie.org.uk
Wed Jan 30 07:19:12 EST 2008


On 29 Jan, 18:11, walterbyrd <walterb... at iname.com> wrote:
> I don't know much php either, but running a php app seems straight
> forward enough.

I think that this (the ease of PHP application deployment) is one of
the things that keeps Python framework developers up at night,
regardless of whether the cause is technical (what processes or
components are running) or social (that hosting providers install
enough of the useful PHP stuff for people not to care about wanting to
install more).

> Python seems to always use some sort of development environment vs
> production environment scheme. For development, you are supposed to
> run a local browser and load 127.0.0.1:5000 - or something like that.
> Then to run the same thing in a development environment, I have to
> configure some files, or touch all the files, restart the web-server,
> or something. Why is that?

You can deploy Python Web applications using anything as simple as CGI
(which only requires a single change to the Web server setup), right
up to the full application server configuration. For a long time I've
advocated the ability to be able to do this without having to switch
frameworks and rewrite your code: that's what my WebStack package [1]
is all about, and I guess that given the availability of the right
adaptors and framework support, WSGI should let you do this as well.

> Python also seems to require some sort of "long running processes" I
> guess that the python interpretor has to running all of time.

Not so: deploying anything as a CGI script/program means that the
application code is only run when a request is made to the
application. Lots of Python software can use this approach: MoinMoin,
ViewVC, Trac... (All these things have, notably, implemented their own
mechanisms for abstracting away the deployment technology, since they
also work with things like mod_python. Another sad example of the
community not coalescing around standards, although I think they're
all looking into WSGI now.)

> I am not really sure about what wsgi is supposed to accomplish.

It's supposed to decouple the deployment technologies from the
framework technologies, or at least that's what I'd use it for, and if
all frameworks supported it, you'd supposedly be able to take, say,
your Django application and run it on Zope 3, or your TurboGears
application and run it on Twisted. Of course, you'd write your Django
code differently from any Zope 3 code in your application, and the
TurboGears code wouldn't look a lot like Twisted code, but that's
another issue entirely.

Paul

[1] http://www.python.org/pypi/WebStack



More information about the Python-list mailing list