[Ilugc] Simple Python Web Application

  • From: steve@xxxxxxxxxxxx (steve)
  • Date: Mon Jul 12 14:45:00 2010

On 07/12/2010 02:01 PM, Bharathi Subramanian wrote:

Hi All,

I wrote a very simple python web application (using CGI), which accept
a student roll number and show the student's detail from the DB. While
searching, I got many CGI, mod_python, WSGI based examples. Which is
the proper way? If possible, plz point to some good example/tutorial.


The problem with web development in python is there are so many choices ! It 
really depends on what you want to do and how simple/complicated your 
application is.

For a mostly static site with only a few form submission/query pages, cgi 
(using 
the cgi module) should be sufficient. If you need to 'host' your entire 
site/web 
application using python, you might want to consider a framework based on WSGI. 
WSGI has become an unofficial 'standard' on how to write web applications in 
python. However, you'd almost never use a standalone WSGI server implementation.

My own preference is cherrypy + SQLObject (database) + Genshi (templating), 
which is a good balance between light-weight cgi like application and 
full-stack 
frameworks like Django.

Some links that might help you make your own choice:
http://docs.python.org/howto/webservers.html
http://wiki.python.org/moin/CgiScripts
http://wiki.python.org/moin/WebFrameworks

cheers,
- steve
-- 
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/

Other related posts: