Skip to content
This repository was archived by the owner on Oct 21, 2018. It is now read-only.

Commit 37101ff

Browse files
committed
Merge pull request #29 from azaze1/os.chdir
added call to os.chdir if os.path.curdir is not the top level dir
2 parents b6c1e91 + 4914b27 commit 37101ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

application.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
from flaskext.redis import RedisManager
1414
from flaskext.helpers import render_html
1515

16+
# handle relative path references by changing to project directory
17+
run_from = os.path.dirname(os.path.abspath(sys.argv[0]))
18+
if run_from != os.path.curdir:
19+
os.chdir(run_from)
1620

1721
# create our little application :)
1822
app = Flask(__name__)

0 commit comments

Comments
 (0)