I am happy to announce the release of Paste 1.0. This release includes all the major components: Paste (core), Paste Script, Paste Deploy, and Paste WebKit.
In all honesty Paste passed the 0.x stage a long time ago. But now it's official: Paste is really stable. How stable? A lot stable. APIs won't be shifting without due warning, and only if there's a good reason. The scope of Paste is also going to be more constrained -- new work should happen outside of Paste. I've already started this a while ago, making most new projects of mine independent packages. This is fine for Paste, because Paste does not encourage integration, and a module under the paste namespace has no special abilities or privilege.
Of course, some work will continue in Paste, but the focus will be on expanding and polishing what's already there, while larger work may take the form of extracting pieces from Paste (this may very well happen for paste.exceptions, paste.evalexception and paste.auth)
I realize I haven't tried to explain What Paste Is for a long time. It used to be a hobby of mine to misexplain it. Maybe it's time to try again.
Three entirely different things. Maybe more. These form some sort of unified strategy in my mind -- though only an incomplete strategy -- but there's no reason you should even worry about that.
This is the main Paste package. This is a bunch of WSGI components. It does all sorts of nice little things. There's an HTTP server in there. There's an HTTP proxying setup. There's a exception catcher. There's something like Apache's ErrorDocument. There's a system for doing internal subrequests. There's some URL parsing. There's static file serving. There are a variety of debugging tools. There's several library routines to handle particular situations in WSGI, like parsing form variables, reading headers, generating error responses, etc.
You can use all of these, though that's unlikely. You can use several. You can use just one. Not much buy-in is really required.
Several of these pieces are kind of low-level. Often a higher-level framework like Pylons or CleverHarold will wrap these pieces up in a more tasty and cohesive package. Some actually are more deployment-related, like the prefix-based routing in paste.urlmap, and so you might use them directly.
You can even write your own web framework with Paste. It's really quite easy, you should totally give it a try.
Paste Deploy is a concept, and an implementation.
The concept is that you can represent pieces of a WSGI stack with some simple functions. Each part is pretty simple: paste.app_factory is a factory that builds WSGI applications. paste.filter_app_factory is a factory that wraps applications with middleware. paste.server_runner is a function that runs a server with your application. Each kind of function has a particular kind of signature, and if you can wrap your app/middleware/server in that kind of function then other people can handle it in a consistent way.
The implementation is a system that builds a stack of apps, middleware, and a server using an INI-style configuration file.
Paste Script is some command-line glue, and some bits and pieces.
As command-line glue, it lets you do things like load a config file (with Paste Deploy), then actually run it. And little things like change the user ID, daemonize, etc.
It also has stuff to build the file layout for new projects.
It also has some stuff to do application deployment.
So that's Paste. If you think you Don't Really Get It, it's probably because you think there's more to it than there is.
或是邮件反馈可也:
askdama[AT]googlegroups.com
订阅 substack 体验古早写作:
关注公众号, 持续获得相关各种嗯哼: