Pros and Cons of different approaches to web programming in Python
<p>I'd like to do some server-side scripting using Python. But I'm kind of lost with the number of ways to do that.</p>

<p>It starts with the do-it-yourself CGI approach and it seems to end with some pretty robust frameworks that would basically do all the job themselves. And a huge lot of stuff in between, like <a href="http://webpy.org/">web.py</a>, <a href="http://pyroxide.org/">Pyroxide</a> and <a href="http://wiki.python.org/moin/Django">Django</a>.</p>

<ul>
<li>What are the <strong>pros</strong> and <strong>cons</strong> of the frameworks or approaches that <em>you've worked on</em>?</li>
<li>What <strong>trade-offs</strong> are there?</li>
<li>For <strong>what kind of projects</strong> they do well and for what they don't?</li>
</ul>

<p>Edit: I haven't got much experience with web programing yet.<br />
I would like to avoid the basic and tedious things like parsing the URL for parameters, etc.<br />
On the other hand, while the video of <a href="http://www.rubyonrails.org/screencasts">blog created in 15 minutes</a> with <a href="http://www.rubyonrails.org/">Ruby on Rails</a> left me impressed, I realized that there were hundreds of things hidden from me - which is cool if you need to write a working webapp in no time, but not that great for really understanding the magic - and that's what I seek now.</p>

<p>CGI is great for low-traffic websites, but it has some performance problems for anything else.  This is because every time a request comes in, the server starts the CGI application in its own process.  This is bad for two reasons:  1)  Starting and stopping a process can take time and 2) you can't cache anything in memory.  You can go with FastCGI, but I would argue that you'd be better off just writing a straight <a href="http://www.python.org/dev/peps/pep-0333/">WSGI</a> app if you're going to go that route (the way WSGI works really isn't a whole heck of a lot different from CGI).</p>

<p>Other than that, your choices are for the most part how much you want the framework to do.  You can go with an all singing, all dancing framework like Django or Pylons.  Or you can go with a mix-and-match approach (use something like CherryPy for the HTTP stuff, SQLAlchemy for the database stuff, paste for deployment, etc).  I should also point out that most frameworks will also let you switch different components out for others, so these two approaches aren't necessarily mutually exclusive.</p>

<p>Personally, I dislike frameworks that do too much magic for me and prefer the mix-and-match technique, but I've been told that I'm also completely insane.  :)</p>

<p>How much web programming experience do you have?  If you're a beginner, I say go with Django.  If you're more experienced, I say to play around with the different approaches and techniques until you find the right one.</p>
