14个简约的Python Web开发框架
bobo
Bobo is a light-weight framework for creating WSGI web applications. It’s goal is to be easy to use and remember.
It addresses 2 problems:
1) mapping URLs to objects and
2) calling objects to generate HTTP responses.
Bobo doesn’t have a templating language, a database integration layer, or a number of other features that are better provided by WSGI middle-ware or application-specific libraries. Bobo builds on other frameworks, most notably WSGI and WebOb.
Bottle
Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.
It provides support for apps like the Google App Engine, Python Paste, and includes several templates like Cheetah and Mako.
CherryPy
CherryPy allows developers to build web applications in much the same way they would build any other object-oriented Python program. This results in smaller source code developed in less time. CherryPy will allow you to do a lot of the normal Python programming, but it does not come integrated with a templating system – which you’ll have to find for yourself. (it supports all the major ones)
CherrPy very much adapts the default Python functionality and structure, and is merely a link between being able to develop web applications with less code.
Cyclone
Cyclone is a web server framework for Python that implements the Tornado API as a Twisted protocol.
I will pass on the explanation of this framework to Gleicon from 7co. Read his post about Cyclone and how it operates.
Flask
A microframework based on Werkzeug, Jinja2 and good intentions
Flask is a micro-framework for Python based on Werkzeug and Jinja2. It’s intended for getting started very quickly and was developed with best intentions in mind. You’ll learn a little bit more on Wikipedia.
Itty-Bitty
itty.py is a little experiment, an attempt at a Sinatra influenced micro-framework that does just enough to be useful and nothing more.
Currently supports:
- Routing
- Basic responses
- Content-types
- HTTP Status codes
- URL Parameters
- Basic GET/POST/PUT/DELETE support
- User-definable error handlers
- Redirect support
- File uploads
- Header support
- Static media serving
Beware! If you’re looking for a proven, enterprise-ready framework, you’re in the wrong place. But it sure is a lot of fun.
Klein
Klein is a micro-framework for developing production-ready web services with Python. It’s built on widely used and well tested components like Werkzeug and Twisted, and has near-complete test coverage. You can check out this post for a tiny introduction. (might be outdated)
Morepath
Morepath is a Python web microframework, with super powers. Morepath is an Python WSGI microframework. It uses routing, but the routing is to models. Morepath is model-driven and flexible, which makes it expressive. There are some details and tips about Morepath on this blog.
ObjectWeb
ObjectWeb is a fast, minimalist, pure-Python web framework that relies on no third party libraries. It is designed around using Python as it was originally intended to be used: as an Object Oriented Programming language. ObjectWeb supports the CGI and WSGI standards and has a built-in development server. I think it’s being developed by this guy.
Pecan
Pecan was created to fill a void in the Python web-framework world – a very lightweight framework that provides object-dispatch style routing. Pecan does not aim to be a “full stack” framework, and therefore includes no out of the box support for things like sessions or databases. Pecan instead focuses on HTTP itself.
Pyramid
Pyramid is a very general open source Python web framework. As a framework, its primary job is to make it easier for a developer to create an arbitrary web application. The type of application being created isn’t really important; it could be a spreadsheet, a corporate intranet, or a social networking platform. Pyramid is general enough that it can be used in a wide variety of circumstances.
You can learn a lot more about Pyramid by reading / watching this tutorial by Caliv from SixFeetUp.
Tornado
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.
Thomas Allen has a simple tutorial on how Tornado words and how to create simple static pages.
web.py
web.py is a web framework for Python that is as simple as it is powerful. web.py is in the public domain; you can use it for whatever purpose with absolutely no restrictions. You can check out a guide and a tiny comparison to Django (well, I don’t think we can call it comparison) on Lucas’s Kauffman’s blog.
Wheezy Web
A lightweight, high performance, high concurrency WSGI web framework with the key features to build modern, efficient web.
Here is a little introduction to Wheezy from Andriy Kornatskyy.