view piecrust/wsgiutil/cwdapp.py @ 787:f6f9a284a5f3

routing: Simplify how route functions are declared and handled. * Site config now only has to declare the function name. * Simply code for running route functions.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 01 Sep 2016 23:00:58 -0700
parents d40b744a9d99
children
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.wsgiutil import get_app


root_dir = os.getcwd()
app = get_app(root_dir)
# Add this for `mod_wsgi`.
application = app