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?
I would like to know some options that may help with:
Thank you!
PS: It is for Python 2.6.5, if that makes a difference
Twisted Web It is a web server that comes with the Twisted networking library. Whereas Twisted itself is "an event-driven networking engine", the Twisted Web server runs on WSGI and it is capable of powering other Python web applications.
Python supports a webserver out of the box. You can start a web server with a one liner. But you can also create a custom web server which has unique functionality.
Gunicorn is a Python WSGI HTTP server. Its common use case is serving Flask or Django Python applications through WSGI interface on production.
Django's primary deployment platform is WSGI, the Python standard for web servers and applications.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With