Want to improve this question? Update the question so it can be answered with facts and citat开发者_运维百科ions by editing this post.
Closed 9 years ago.
Improve this questionI 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?
I would like to know some options that may help with:
- Python based local web development in my own laptop/ PC.
- Creating production ready Python web applications.
Thank you!
PS: It is for Python 2.6.5, if that makes a difference
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()
I realize this question was posted a long time ago, but Zope would be an alternative http://www.zope.org/
There is Django. I guess this could do the job.
Here is a good overview about this.
- CherryPy http://www.cherrypy.org/
- Google AppEngine appengine.google.com
- Apache mod_py apache.org
- lighthttp must also have python support lighthttp.org
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
精彩评论