pyserv.wsgi module

Simple WSGI server for serving swagger or basic flask apps in an engineering development environment.

pyserv.wsgi.main(args=None)[source]

The serv entry point wrapper; both args are optional, but you must provide either APP or APP and PORT.

Usage:

wsgi [APP] [PORT]
pyserv.wsgi.wsgi_init(wapp, port, validate=True)[source]

Init wsgi server for handler handoff; init logging and simple_server classes.

Parameters:
  • wapp – initialized WSGI app to run

  • port – initialized listen port

Return wsgi_handler:

wsgi handle, eg, wsgid.serve_forever()

pyserv.wsgi.wsgi_run(app=<function demo_app>, port='8000')[source]

Run in foreground command wrapper for WSGI console entry point; init logging and server, run the server, stop the server.

Parameters:
  • app – WSGI app (defaults to demo_app if not provided)

  • port – WSGI server listen port