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.
2018-07-17 18:57:29 +00:00
|
|
|
"""
|
|
|
|
An exemplifying Apache python WSGI to a Devicehub app.
|
|
|
|
|
|
|
|
Based in http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/
|
|
|
|
|
2018-09-18 14:05:54 +00:00
|
|
|
You only need to modify ``app_dir``.
|
2018-07-17 18:57:29 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
app_dir = Path(__file__).parent
|
2018-09-18 14:05:54 +00:00
|
|
|
"""The **directory** where app.py is located. Change this accordingly."""
|
|
|
|
|
2018-07-17 18:57:29 +00:00
|
|
|
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
|
2018-09-18 14:05:54 +00:00
|
|
|
from app import app as application
|