Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Web/application servers to use for Python [closed]

Tags:

python

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:

  1. Python based local web development in my own laptop/ PC.
  2. Creating production ready Python web applications.

Thank you!

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

like image 427
StupidLearner Avatar asked Aug 12 '10 12:08

StupidLearner


People also ask

Which web server is used for Python?

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.

Does Python have a web server?

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.

Which server is best for Flask?

Gunicorn is a Python WSGI HTTP server. Its common use case is serving Flask or Django Python applications through WSGI interface on production.

Which web server does Django use?

Django's primary deployment platform is WSGI, the Python standard for web servers and applications.


2 Answers

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()
like image 127
svenwltr Avatar answered Sep 30 '22 13:09

svenwltr


I realize this question was posted a long time ago, but Zope would be an alternative http://www.zope.org/

like image 28
Jeff D Avatar answered Sep 30 '22 13:09

Jeff D