Attention
You are looking at outdated documentation for version 1.x. A newer version is available.
5.5.3.4.1. wsgidav.server.ext_wsgiutils_server¶
ext_wsgiutils_server.py is an extension of the wsgiutils server in Paste. It supports passing all of the HTTP and WebDAV (rfc 2518) methods.
It includes code from the following sources:
wsgiServer.py
from wsgiKit <http://www.owlfish.com/software/wsgiutils/> under PSF license,
wsgiutils_server.py
from Paste <http://pythonpaste.org> under PSF license,
flexible handler method <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307618> under public domain.
5.5.3.4.1.1. Running as standalone server¶
To run as a standalone server using the bundled ext_wsgiutils_server.py:
usage: python ext_wsgiutils_server.py [options] [config-file]
config-file:
The configuration file for WsgiDAV. if omitted, the application
will look for a file named 'WsgiDAV.conf' in the current directory
options:
--port=PORT Port to serve on (default: 8080)
--host=HOST Host to serve from (default: localhost, which is only
accessible from the local computer; use 0.0.0.0 to make your
application public)
-h, --help show this help message and exit
5.5.3.4.1.2. Running using other web servers¶
To run it with other WSGI web servers, you can:
from wsgidav.mainappwrapper import PyFileApp
publish_app = PyFileApp('WsgiDAV.conf')
# construct the application with configuration file
# if configuration file is omitted, the application
# will look for a file named 'WsgiDAV.conf'
# in the current directory
where publish_app
is the WSGI application to be run, it will be called with
publish_app(environ, start_response)
for each incoming request, as described in
WSGI <http://www.python.org/peps/pep-0333.html>
Note: if you are using the paster development server (from Paste <http://pythonpaste.org>), you can
copy ext_wsgi_server.py
to <Paste-installation>/paste/servers
and use this server to run the
application by specifying server='ext_wsgiutils'
in the server.conf
or appropriate paste
configuration.
Functions
StringIO |
StringIO([s]) – Return a StringIO-like stream for reading or writing |
serve (conf, app) |
Classes
ExtHandler (request, client_address, server) |
|
ExtServer (serverAddress, wsgiApplications[, …]) |