webob.static – Serving static files — WebOb 1.4.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- WebOb 1.4.1 documentation »

# `webob.static` – Serving static files

class `webob.static.` `FileApp`(filename, **kw)

  An application that will send the file at the given filename.

  Adds a mime type based on mimetypes.guess_type().

class `webob.static.` `DirectoryApp`(path, index_page='index.html', hide_index_with_redirect=False, **kw)

  An application that serves up the files in a given directory.

  This will serve index files (by default `index.html`), or set `index_page=None` to disable this. If you set `hide_index_with_redirect=True` (it defaults to False) then requests to, e.g., `/index.html` will be redirected to `/`.

  To customize FileApp instances creation (which is what actually serves the responses), override the make_fileapp method.

### Navigation

- index
- modules |
- next |
- previous |
- WebOb 1.4.1 documentation »