From 5c44e495b7e861b642b1c7aec443e2795fd80600 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Wed, 10 Aug 2011 00:53:15 +0200 Subject: [PATCH] get ready for production, baby :) --- budget/web.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/budget/web.py b/budget/web.py index 661b1395..b98e7648 100644 --- a/budget/web.py +++ b/budget/web.py @@ -14,6 +14,15 @@ app = Flask(__name__) app.config.from_object("default_settings") mail = Mail() +# db +db.init_app(app) +db.app = app +db.create_all() + +# mail +mail.init_app(app) + + @app.route("/") def home(): project_form = ProjectForm() @@ -199,14 +208,6 @@ def delete_bill(project, bill_id): def main(): - # db - db.init_app(app) - db.app = app - db.create_all() - - # mail - mail.init_app(app) - app.run(host="0.0.0.0", debug=True) if __name__ == '__main__':