Skip to content

Commit

Permalink
added call to os.chdir if os.path.curdir is not the top level project…
Browse files Browse the repository at this point in the history
… directory
  • Loading branch information
Robert Glen committed Mar 31, 2014
1 parent b6c1e91 commit 4914b27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
from flaskext.redis import RedisManager
from flaskext.helpers import render_html

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

# create our little application :)
app = Flask(__name__)
Expand Down

0 comments on commit 4914b27

Please sign in to comment.