comparison 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
comparison
equal deleted inserted replaced
375:aade4ea57e7f 376:21687b933193
1 # This is a utility module that can be used with any WSGI-compatible server
2 # like Werkzeug or Gunicorn. It returns a WSGI app for serving a PieCrust
3 # website located in the current working directory.
4 import os
5 from piecrust.serving.server import Server
6
7
8 root_dir = os.getcwd()
9 server = Server(root_dir, sub_cache_dir='prod', enable_debug_info=False)
10 app = server.getWsgiApp()
11