On Aug 8, 2007, at 10:57 AM, walterbyrd wrote:

I like Python better than PHP, but I think there may be compelling
advantages to PHP when it comes to frameworks. Issues that concerns me
with Python, and Python frameworks, include: hosting, deployment,
configuration and administrative overhead.

Of course, no tool is perfect for every job.

I get the impression that Python framework developers just assume the
user has complete control over the server. Those who develop Python
frameworks seem to have little regard for the realities of shared
hosting. System requirements tend to be sky-high: Apache 2.x,
mod_python (latest version), fastcgi (at least), command line access,
PostgreSQL (recommended). Assuming you can meet the system
requirements, you still have server configuration issues such as
setting up the Path, and maybe the .htaccess file.

You could use Apache 1.x as well, or nginx, or lighttpd, or any webserver capable of proxying requests (assuming you want to run a standalone process for the Pylons app).

Then there is the ongoing configuration. I wonder if Pylons is any
better than Django in this regard, or maybe it's not as big an issue
it seems.

I think they both have similar options, Pylons has a few more since it uses less globals. Ie, you can run it stand-alone and its quite fast, then you merely proxy back to it. This uses less resources since a single threaded app can handle multiple requests at once, rather than loading up Apache+mod_python and having your app in every server process.

For example, as I understand it, in Django:
* The database model has to be manually synced to database from the
command line, anytime any change is made to the database.

Using SQLalchemy's table introspection, no changes would be needed to your models if the database is changed.

* A configuration file has to be created for every application.

Of course, since every application might have different requirements, different databases it talks to, etc. This is common in most every framework I've seen, including PHP frameworks (you do configure the db uri somewhere, no?).

* Urls have to be configured in the urls.py file to match the view.

Yep, in Pylons there's Routes which is a little easier than writing regular expressions. You also don't need to write a new one for every controller, as the default routing can handle all your controllers and views with no additional tweaking to a routing file.

* The webserver has to be restarted every time modify your code - or
touch every file if using fastcgi.

This applies to Pylons as well, unless you're updating templates. Template updates (in Mako, Myghty and Genshi at least) do not require server restarts.

From what I am gathering, Pylons requires a similar amount of ongoing
configuration. I don't think this amount of configuration is required
by Rails, or the PHP frameworks. Am I wrong about that? And is it
really an issue?

Rails involves all the same things, if not more since the recommended way to deploy Rails is to run a Mongrel cluster of processes that are then proxied back to (preferably with the proxy load balancer in Apache 2.2). You also have config files, and the same routing stuff as in Pylons.

There are quite a few cheap hosting solutions that do allow command access, and let you run your own process and/or use Fast CGI. So I don't think the hosting situation was as bleak for those not running their own servers as it was a year or two ago.

WebFaction comes with a control panel to manage your Pylons app:
http://www.webfaction.com/pylons-hosting

And ppl are running Pylons, Django, and Rails apps on Dreamhost and other hosting providers as well.

It is generally assumed that part of the appeal of these frameworks, is a more rigorous development cycle with testing. It's usually rather easy to run these frameworks stand-alone on your own computer to test and develop them, then when you're sure it works, you push it out to the server.

HTH,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to