Skip to content

Commit 06170f5

Browse files
committed
app.py - project_root added to the path to allow loading from Apache/iis
app.wsgi is redundant, use app.py instead
1 parent 5600ffc commit 06170f5

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323

2424
import flask
2525

26-
from set_root import set_root
2726
# we need to set the root before we import the main_page as there are relative paths to this root (i.e. config files)
28-
set_root()
27+
import sys
28+
import os
29+
project_root = os.path.dirname(os.path.abspath(__file__))
30+
sys.path.insert(0, project_root)
31+
os.chdir(project_root)
2932

3033
from app_main_page import main_page
3134

3235
app = flask.Flask(__name__)
3336
app.register_blueprint(main_page)
3437

38+
application = app # application is the default name for mod_wsgi
3539

3640
if __name__ == "__main__":
3741
app.run()

app.wsgi

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)