The choice of Request class determines how you wish to deploy your application. Albatross supplies a number of pre-built Request implementations suited to various deployment methods. You should import the Request method from the appropriate module:
Deployment Method | Request Module |
---|---|
CGI | albatross.cgiapp |
mod_python | albatross.apacheapp |
FastCGI_python | albatross.fcgiapp |
Stand-alone Python HTTP server | albatross.httpdapp |
By placing all deployment dependencies in a Request class you are able to change deployment method with only minimal changes to your application mainline code. You could, for instance, carry out your initial development as a CGI application and final deployment inside Apache.
You could also develop your own Request class to deploy an Albatross application in other ways, such as using the Medusa web server (http://www.nightmare.com/medusa/), or to provide a Request class which for performing unit tests on your application.
All Request classes implement the same interface. Much of this interface can be supplied by the RequestBase mixin.
name) |
TRUE
if the field identified by the name argument
is present in the request.
name) |
name) |
) |
) |
) |
name) |
name, value) |
) |
loc) |
data) |
status) |
num) |
) |
from albatross.apacheapp import Request : : def handler(req): return app.run(Request(req))