This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
mandaye-cud/mandaye_cud/wsgi.py

24 lines
595 B
Python

import os
os.environ.setdefault("MANDAYE_CONFIG_MODULE", "mandaye_cud.config")
from beaker.middleware import SessionMiddleware
from whitenoise import WhiteNoise
from mandaye_cud import config
import mandaye
from mandaye.server import MandayeApp
# production
application = SessionMiddleware(MandayeApp(), config.session_opts)
# development
mandaye_path = os.path.dirname(mandaye.__file__)
application_dev = WhiteNoise(application,
root=os.path.join(mandaye_path, 'static'),
prefix=config.static_url)
application_dev.add_files(config.static_root, prefix=config.static_url)