This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/examples/wsgi.wsgi
Xavier Bustamante Talavera 10e56e8ed6 Use venv from mod-apache
2018-09-18 16:05:54 +02:00

24 lines
561 B
Python

"""
An exemplifying Apache python WSGI to a Devicehub app.
Based in http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/
You only need to modify ``app_dir``.
"""
from pathlib import Path
import sys
app_dir = Path(__file__).parent
"""The **directory** where app.py is located. Change this accordingly."""
assert app_dir.is_dir(), 'app_dir must point to a directory: {}'.format(app_dir)
app_dir = str(app_dir.resolve())
# Load the app
# ------------
sys.path.insert(0, str(app_dir))
# noinspection PyUnresolvedReferences
from app import app as application