views:

103

answers:

4

Hello,

I would like to start writing Python web apps, first start simple like servlets in Java, then move to some web frameworks.

What server could I use to develop the apps? Is there a Tomcat version for Python? Is Apache with mod_python the way to go or something else?

Thank you!

PS: It is for Python 2.6.5, if that makes a difference

+1  A: 

There is Django. I guess this could do the job.

Here is a good overview about this.

schoetbi
Do all frameworks contain a server? Are there differences between them (i.e. You can run only one type of framework on one type of server). Is there something like a "servlet" specificaction that all respect (sorry... I only know how stuff works in Java, I'm trying to understand by comparison)
StupidLearner
For a comparison of the j2ee terms to the python appserver terms check this out: http://www.boddie.org.uk/python/web_modules_enterprise.html. Here another good source:http://list.fudosys.com/pipermail/calendula-devel/2004-April/000058.html
schoetbi
+2  A: 

Tomcat is as far as I know only for Java.

You could use the Django-Framework. It has a integrated developmentserver and you can use Apache for a productive enviroment. But i recommend mod_wsgi instead of mod_python.

Here is an example for an wsgi application with apache and django:

# Apache Config
<VirtualHost *>
    ServerName example.com
    WSGIScriptAlias / /var/www/example/site.wsgi
    ErrorLog /var/log/apache2/error.log
</VirtualHost>


# site.wsgi
import os
import sys

sys.path.append( rel(".") )

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Sven Walter
A: 
  • CherryPy http://www.cherrypy.org/
  • Google AppEngine appengine.google.com
  • Apache mod_py apache.org
  • lighthttp must also have python support lighthttp.org
daemonfire300
A: 

I would highly suggest learning Twisted. It makes webservers easy. It is an asynchronous framework the relies on the idea of callbacks. You set up a server. You define how the server responds to different inputs. And then as it receives data it will call the proper methods to handle each incoming request. the twisted.web http module is also very robust yet easy to step into. Great place to start.

See: the following

themaestro