view piecrust/wsgiutil/cwdapp.py @ 376:21687b933193

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.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 07 May 2015 22:47:44 -0700
parents
children fe8a58817088
line wrap: on
line source

# 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()