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/mandaye/skel/example.module/wsgi.py

28 lines
785 B
Python
Raw Normal View History

2014-04-17 19:56:08 +02:00
import os
from {project_name} import default_config
2014-04-17 19:56:08 +02:00
if os.environ.has_key('MANDAYE_CONFIG_FILES'):
os.environ['MANDAYE_CONFIG_FILES'] = default_config + ' ' + \
os.environ['MANDAYE_CONFIG_FILES']
else:
os.environ['MANDAYE_CONFIG_FILES'] = default_config
2014-04-17 19:56:08 +02:00
from beaker.middleware import SessionMiddleware
from whitenoise import WhiteNoise
2014-04-17 19:56:08 +02:00
import mandaye
from mandaye import config
2014-06-04 11:04:19 +02:00
from mandaye.server import MandayeApp
2014-04-17 19:56:08 +02:00
# production
2014-04-17 19:56:08 +02:00
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)
2014-04-17 19:56:08 +02:00