5.3.4 static

The aspen.handlers.static module defines one function:

wsgi( environ, start_response)

This handler serves environ['PATH_TRANSLATED'] as a static resource. The Content-Type is set using the standard library's mimetypes.guess_type function, defaulting to text/plain. In staging and production mode, we obey any If-Modified-Since header.

This handler adapts to the autoindex setting in the [static] section of aspen.conf. If set to yes (the default), then the aspen.handlers.autoindex.wsgi handler will be used to serve requests for directories. If set to no, the aspen.handlers.http.HTTP403 handler is used instead. The autoindex value is case-insensitive, but if other than yes or no is given, ConfigError is raised at start-up.

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