From 13d860111718cc267076e0e54c5e7e31caf48629 Mon Sep 17 00:00:00 2001 From: Vidya Ramakrishnan Date: Thu, 4 May 2017 14:22:29 +0530 Subject: [PATCH] Make init_for calls automatic Fixes #13 --- kharcha/__init__.py | 11 +++++------ manage.py | 4 ++-- runserver.py | 5 ++--- website.py | 3 +-- website.wsgi | 3 +-- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/kharcha/__init__.py b/kharcha/__init__.py index 96143e3..98efabe 100644 --- a/kharcha/__init__.py +++ b/kharcha/__init__.py @@ -21,9 +21,8 @@ # Configure the app -def init_for(env): - coaster.app.init_app(app, env) - baseframe.init_app(app, requires=['baseframe', 'jquery.expander', 'kharcha']) - lastuser.init_app(app) - lastuser.init_usermanager(UserManager(models.db, models.User, models.Team)) - app.config['tz'] = timezone(app.config['TIMEZONE']) +coaster.app.init_app(app) +baseframe.init_app(app, requires=['baseframe', 'jquery.expander', 'kharcha']) +lastuser.init_app(app) +lastuser.init_usermanager(UserManager(models.db, models.User, models.Team)) +app.config['tz'] = timezone(app.config['TIMEZONE']) diff --git a/manage.py b/manage.py index 43d1f58..7f1b391 100755 --- a/manage.py +++ b/manage.py @@ -3,10 +3,10 @@ from coaster.manage import init_manager from kharcha.models import db -from kharcha import app, init_for +from kharcha import app if __name__ == '__main__': db.init_app(app) - manager = init_manager(app, db, init_for) + manager = init_manager(app, db) manager.run() diff --git a/runserver.py b/runserver.py index 296e2fe..e9abc26 100755 --- a/runserver.py +++ b/runserver.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -from kharcha import app, init_for +from kharcha import app from kharcha.models import db -init_for('dev') db.create_all() -app.run('0.0.0.0', debug=True, port=9000) +app.run('0.0.0.0', port=9000) diff --git a/website.py b/website.py index d25658a..111761c 100644 --- a/website.py +++ b/website.py @@ -1,5 +1,4 @@ import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) -from kharcha import app as application, init_for -init_for('production') +from kharcha import app as application diff --git a/website.wsgi b/website.wsgi index d25658a..111761c 100644 --- a/website.wsgi +++ b/website.wsgi @@ -1,5 +1,4 @@ import sys import os.path sys.path.insert(0, os.path.dirname(__file__)) -from kharcha import app as application, init_for -init_for('production') +from kharcha import app as application