# HG changeset patch # User Ludovic Chabant # Date 1431064064 25200 # Node ID 21687b9331932fe6ff162a198d0f1a810c7d8eb3 # Parent aade4ea57e7f166b8ced5ba3ec65815d5ff3da4e serve: Add a WSGI utility module for easily getting a default app. This makes it easy to run Gunicorn from the command-line using the Gunicorn script instead of the `chef serve` command. diff -r aade4ea57e7f -r 21687b933193 piecrust/wsgiutil/__init__.py diff -r aade4ea57e7f -r 21687b933193 piecrust/wsgiutil/cwdapp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piecrust/wsgiutil/cwdapp.py Thu May 07 22:47:44 2015 -0700 @@ -0,0 +1,11 @@ +# This is a utility module that can be used with any WSGI-compatible server +# like Werkzeug or Gunicorn. It returns a WSGI app for serving a PieCrust +# website located in the current working directory. +import os +from piecrust.serving.server import Server + + +root_dir = os.getcwd() +server = Server(root_dir, sub_cache_dir='prod', enable_debug_info=False) +app = server.getWsgiApp() +