views:

384

answers:

2

I'm trying to understand what paste script and paster are. The website is far from clear. I used paster to generate pre-made layouts for projects, but I don't get the big picture.

As far as I understand, and from the wikipedia entry, it says it's a framework for web frameworks, but that seems reductive. paster create seems to be able to create pre-made layouts for setuptools/distutils enabled packages.

What is the problem (or set of problems) it's trying to solve?

+2  A: 

Paste got several components:

  • Paste Core: various modules to aid in creating wsgi web apps or frameworks (module index). Includes stuff like request and response objects. From the web site: "The future of these pieces is to split them into independent packages, and refactor the internal Paste dependencies to rely instead on WebOb". If you're considering using components from paste core, I suggest you look at the spin-offs instead, like WebOb.
  • Paste Deploy: a system for loading and configuring WSGI applications and servers (module index). Basically some stuff to read a config file and create a WSGI app as specified in the file.
  • Paste Script: A framework for defining commands. It comes with a few commands out of the box, like paster serve (loads and serves a WSGI application defined in a Paste Deploy config file) and paster create (creates directory layout for packages etc). The best intro to paste script I found is http://pythonpaste.org/script/developer.html

Here's the source for the paster serve command: serve.py.

And paster create: create_distro.py.

codeape
+2  A: 

PasteScript (and its companion PasteDeploy) are tools for running Python code using 'entry points'. Basically, a python library can specify in metadata that it knows how to create a certain kind of Python project, or perform certain operations on those projects. paster is a commandline tool that looks up the appropriate code for the operation you requested. It's a very general kind of problem; if you're familiar with Ruby at all, the equivalent might be 'rake'.

In particular, PasteDeploy is a configuration format to serve Python webapps using paster. Both PasteScript and PasteDeploy are important for the Pylons web framework.

inklesspen