cheroot.cli module#
Command line tool for starting a Cheroot WSGI/HTTP server instance.
Basic usage:
$ # Start a server on 127.0.0.1:8000 with the default settings
$ # for the WSGI app myapp/wsgi.py:application()
$ cheroot myapp.wsgi
$ # Start a server on 0.0.0.0:9000 with 8 threads
$ # for the WSGI app myapp/wsgi.py:main_app()
$ cheroot myapp.wsgi:main_app --bind 0.0.0.0:9000 --threads 8
$ # Start a server for the cheroot.server.Gateway subclass
$ # myapp/gateway.py:HTTPGateway
$ cheroot myapp.gateway:HTTPGateway
$ # Start a server on the UNIX socket /var/spool/myapp.sock
$ cheroot myapp.wsgi --bind /var/spool/myapp.sock
$ # Start a server on the abstract UNIX socket CherootServer
$ cheroot myapp.wsgi --bind @CherootServer
- class cheroot.cli.AbstractSocket(abstract_socket)#
Bases:
BindLocation
AbstractSocket.
- class cheroot.cli.Application(wsgi_app)#
Bases:
object
Application.
- classmethod resolve(full_path)#
Read WSGI app/Gateway path string and import application module.
- server(parsed_args)#
Server.
- server_args(parsed_args)#
Return keyword args for Server class.
- class cheroot.cli.BindLocation#
Bases:
object
A class for storing the bind location for a Cheroot instance.
- class cheroot.cli.TCPSocket(address, port)#
Bases:
BindLocation
TCPSocket.
- class cheroot.cli.UnixSocket(path)#
Bases:
BindLocation
UnixSocket.
- cheroot.cli.main()#
Create a new Cheroot instance with arguments from the command line.
- cheroot.cli.parse_wsgi_bind_addr(bind_addr_string)#
Convert bind address string to bind address parameter.
- cheroot.cli.parse_wsgi_bind_location(bind_addr_string)#
Convert bind address string to a BindLocation.