Skip to content

Commit

Permalink
Use DispatcherMiddleware in wsgi file.
Browse files Browse the repository at this point in the history
  • Loading branch information
dougthor42 committed Jan 29, 2019
1 parent e924da5 commit 637f8de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apache/wsgi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/local/bin/python3
import os

from werkzeug.wsgi import DispatcherMiddleware

from trendlines import create_app

os.environ['TRENDLINES_CONFIG_FILE'] = "/data/trendlines.cfg"
application = create_app()

# Handle cases where we're behind a proxy that is modifying our URL.
if application.config.get('URL_PREFIX', None) is not None:
application = DispatcherMiddleware(
application,
{application.config['URL_PREFIX']: application}
)

0 comments on commit 637f8de

Please sign in to comment.