summaryrefslogtreecommitdiff
path: root/paste/servers/wsgiutils_server.py
blob: ce501f45659c9e0261698aa3a8a1be638be0f9a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from optparse import Option
from paste.util import thirdparty
thirdparty.add_package('wsgiutils')
from wsgiutils import wsgiServer

def serve(conf, app):
    server = wsgiServer.WSGIServer(
        (conf.get('host', 'localhost'),
         int(conf.get('port', 8080))), {'': app})
    server.serve_forever()

description = """\
WSGIUtils <http://www.owlfish.com/software/wsgiutils/> is a small
threaded server using Python's standard SimpleHTTPServer.
"""

options = [
    Option('--port',
           metavar="PORT",
           help='Port to serve on (default: 8080)'),
    Option('--host',
           metavar="HOST",
           help='Host to serve from (default: localhost, which is only accessible from the local computer; use 0.0.0.0 to make your application public)'),
    ]