3.3.2 Static Responders

The Static responder implements the basic publication application: serving public files straight off the filesystem. This responder is designed to be used either by itself or as a mixin. It provides one attributes and two methods:

root
The filesystem path of the directory to use as the publishing root.

defaults
A tuple of names to interpret as default resources. The first-named is chosen first.

respond( request)
This is a pass-through for serve_static, and can safely be overriden.

serve_static( request)
Serves a static resource from the filesystem. request is a Request object. The URI is translated using the httpy.utils.translate function, and the Content-Type: is set by the standard library's mimetypes module. In staging and deployment modes, serve_static supports the 304 Not Modified response.
httpy is Zeta software. It is copyright © 2006 by Chad Whitacre, and is offered free of charge, warranty, and restrictions.