Subsections


4.1 Applications: Path-based Extension

In Aspen, an application or app refers to a WSGI application that is connected to a particular directory. Apps are set up in __/etc/apps.conf.

The __/etc/apps.conf file contains a newline-separated list of white-space-separated path name/object name pairs. The path names refer to URL-space, and are translated literally to the filesystem. If the trailing slash is given, then requests for that directory will first be redirected to the trailing slash before being handed off to the application. If no trailing slash is given, the application will also get requests without the slash. When choosing an application to service a request, the most specific pathname matches first.

Object names are in colon notation, and they name WSGI callables. Aspen updates the SCRIPT_NAME and PATH_INFO settings in environ before handing off to the relevant callable. SCRIPT_NAME will never end with a slash, and if PATH_INFO is not empty, it will always begin with a slash.

Aspen will (over)write a file called README.aspen in each directory mentioned in apps.conf, containing the relevant line from apps.conf. If the directory does not exist, it is created. Aspen will also remove any obsolete README.aspen files within your site tree.

4.1.1 Example apps.conf

/foo        example.apps:foo    # will get both /foo and /foo/
/bar/       example.apps:bar    # /bar will redirect to /bar/
/bar/baz    example.apps:baz    # will 'steal' some of /bar's requests

Aspen is copyright © 2006-2007 by Chad Whitacre and contributors, and is offered under the MIT license.