前6名开源Python应用程序服务器

e2ex 9年前

Top 6 Python Application Servers

Django

Django is a free and open source web application framework, which has been written in the Python language, which follows the model–view–controller (MVC) architectural pattern. It is maintained by the non profit Django Software Foundation (DSF) and is available under a 3 clause BSD License and encourages rapid development and clean, pragmatic design.

It lets you build high-performing, web applications quickly with its primary focus on automating as much as possible. Also included in the core framework are is s lightweight and standalone web server for development and testing (includes the ability to launch a FastCGI server, enabling use behind any web server which supports FastCGI, such as Lighttpd or Hiawatha) It is also possible to use other WSGI-compliant web servers like Apache, NGINX using WSGI, Gunicorn, or Cherokee using flup (a Python module).

Interestingly Django may also be run in conjunction with Jython on any Java EE application server such as GlassFish or JBoss. In this case django-jython must be installed in order to provide JDBC drivers for database connectivity.

Learn more information on how to deploy with WSGI.

Gunicorn

The Gunicorn “Green Unicorn” is a Python Web Server Gateway Interface HTTP Server for Unix and is able to offer a lot of functionality in a significantly easy to operate fashion for developers.

It is a pre-fork worker model, ported from Ruby’s Unicorn project meaning that a central master process (Gunicorn) manages multiple worker processes (of differing types), which then handle and deal with the requests directly. The Gunicorn server is broadly compatible with a number of web application frameworks, simply implemented, light on server resources and fairly fast out of the box.

It comes with native support for WSGI, web2py, Django and Paster, automatic worker process management,simple configuration, multiple worker configurations, server hooks for extensibility and compatible with Python 2.6+ and Python 3.1+ and comes with SSL support.

It is available under a MIT License and developed by Gunicorn Developers.

Python Paste

Python Paste, sometimes also know as paste, is a set of utilities for web development in Python. Paste has been described as “a framework within another framework (web frameworks)” and was originally developed by Ian Bickering.

In terms of the package that comes with Python Paste, there are modules that help in implementing WSGI middleware which includes a WSGI wrapper for CGI applications and also includes a simple web server that can produce WSGI requests. In the future it is the intention that it is separated into more independent packages.

It is available under a MIT License.

Tornado

Tornado is a scalable, non-blocking web server and application development framework   and asynchronous networking library. It was originally developed at FriendFeed (whom were acquired by 非死book in 2009). Tornado is highly scalable and can open many connections, making it ideal for long polling, web sockets, and other applications that require a long-lived connection. It also comes with a WSGI server which other WSGI Python applications (and frameworks) can use to run.

Tornado is open-sourced and available under a Apache 2.0 License

Twisted

Twisted is an event-driven network programming framework which supports TCP, UDP, SSL/TLS, IP multicast and a large number of protocols (including HTTP, XMPP, NNTP, IMAP, SSH, IRC, and FTP amongst others). There is also support for Unix domain sockets and is licensed under the MIT License.

Twisted comes with a web server that runs on WSGI and it is capable of powering other Python web applications allowing developers to use the servers for custom HTTP serving purposes.

CherryPy

CherryPy is an object-oriented web application framework using the Python programming language and is fully self contained. It has been designed for rapid development of web applications through using wrappers for the HTTP protocol.

CherryPy can be used as a web server or can launch one via any WSGI compatible environment and can do this without being bound to CherryPy’s application development frameworkIt. It does not deal with tasks such as templating for output rendering or back end access. The framework is extensible with filters,  can handle static files, support for SSL and is available under a BSD License.

Hopefully you found this guide to Application Servers for Python useful.