aboutsummaryrefslogtreecommitdiff
path: root/budget
diff options
context:
space:
mode:
authorJocelynDelalande <JocelynDelalande@users.noreply.github.com>2017-03-29 11:47:12 +0200
committerGitHub <noreply@github.com>2017-03-29 11:47:12 +0200
commitbf2c11f8a9f14b2553892df92b4d6e44fc21d2a2 (patch)
tree9344f332a4f5bff7d83129b120a1ee0b4899c7b9 /budget
parentce5ceb7f100ff6c1e0692943e1680dc1951f4b63 (diff)
parentf43b3dc41d291dedf25280d951f2e185a9fba9ff (diff)
downloadihatemoney-mirror-bf2c11f8a9f14b2553892df92b4d6e44fc21d2a2.zip
ihatemoney-mirror-bf2c11f8a9f14b2553892df92b4d6e44fc21d2a2.tar.gz
ihatemoney-mirror-bf2c11f8a9f14b2553892df92b4d6e44fc21d2a2.tar.bz2
Merge pull request #190 from spiral-project/use-app-root
Use app.root_path instead of __HERE__
Diffstat (limited to 'budget')
-rw-r--r--budget/run.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/budget/run.py b/budget/run.py
index 9745b60..3ab036b 100644
--- a/budget/run.py
+++ b/budget/run.py
@@ -12,8 +12,6 @@ from api import api
from utils import PrefixedWSGI
from utils import minimal_round
-__HERE__ = os.path.dirname(os.path.abspath(__file__))
-
app = Flask(__name__)
@@ -59,15 +57,16 @@ db.app = app
# db migrations
migrate = Migrate(app, db)
+migrations_path = os.path.join(app.root_path, 'migrations')
if pre_alembic_db():
with app.app_context():
# fake the first migration
- stamp(revision='b9a10d5d63ce')
+ stamp(migrations_path, revision='b9a10d5d63ce')
# auto-execute migrations on runtime
with app.app_context():
- upgrade(os.path.join(__HERE__, 'migrations'))
+ upgrade(migrations_path)
# mail
mail.init_app(app)