Ian Bicking: the old part of his blog

Paste 1.0

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.

What Is Paste?

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.

Paste core

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

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

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.

Conclusion

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.

Created 22 Oct '06

Comments:

Congratulations Ian! Way too many projects never make it to 1.0 and most of the rest are not really 1.0 quality when they get there.

Paste reminds me of Python in its excellent technology and difficult product description. The problem is that people better understand descriptions in terms of what problems the code can solve for them. Consider the difference between: "Python is a general purpose object oriented scripting language popular for rapid prototyping, application building, scientific use and many other things." Compare to: "Ruby is a general purpose programming language most often used to very rapidly build highly mainainable Web sites through its Web Application Framework Rails."

I don't mean to reopen the whole Web Application Framework question but merely offer an analogy. The next time you describe Paste it would help if you would explain in one sentence what problem I would have that would lead me to use it. Is it three different things because it solves three different problems? If so, why does it have a single name? Or is it three different things that solve the same problem?

# Paul Prescod

Best misexplanation yet :-)

Paste is great. Keep up the good work.

# Christian Wyglendowski

Paste was easy to understand once I realized what WSGI enables. (Ben Bangert's Google Tech Talk gives a pretty nice explanation on WSGI.)

The only real problem I see is that most Python web developers don't know that they can ask the questions that Paste is the answer to.

Also, while I don't know whether this WSGI middleware business is exactly "rocket science", I do think that a lot of programmers don't really care about the stuff WSGI and Paste (etc) solve. They should care, of course, but they don't. (PHP is the ultimate proof of this. Not to say that PHP is inherently evil, though.)

# Jarno Virtanen

How about "Paste is a package of python modules for working with HTTP requests and responses."?

Anyhow, Mazel Tov.

# Joe Grossberg

wow already 1.0 :) I just discovered Paste like 1 week ago

And I got tons of questions about it, is there a way to contact you or a discussion forum about Paste ?

# zwetan

# Ian Bicking

How about a screencast? That might be better at explaining how it works.

# Sean

What I found most interesting about this page is that at the time I looked at it there were four Google ads, all of them related to Ruby on Rails (well, the first one was an "alternative to RoR" (Java-based)). So, if anyone clicks, Ian, you're making money off of the competition! :-)

# Joe