#!/usr/bin/env python
"""
A simple example of wrapping a BDFU server in a CGI application.

The BDFU_SETTINGS environment variable should be set to point to an appropriate
configuration file.

Note that it is not normally the case that web servers pass the Authorization
header to CGI programs. (This is one of the many drawbacks with CGI.) In
Apache, for example, the following should be added to the server configuration:

    RewriteEngine on
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

"""
from wsgiref.handlers import CGIHandler
from bdfu.webapp import app
CGIHandler().run(app)

# vi:ft=python

