From ef353d643c274d19e7816e9cfa436e38f1d1edea Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Sep 2011 21:21:37 +0200 Subject: Refactor the application to use blueprints. This allows to isolate some behavior in the context of the web application so the API and the web application can behave in different ways. --- budget/run.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 budget/run.py (limited to 'budget/run.py') diff --git a/budget/run.py b/budget/run.py new file mode 100644 index 0000000..b1fad19 --- /dev/null +++ b/budget/run.py @@ -0,0 +1,22 @@ +from web import main, db, mail +import api + +from flask import * + +app = Flask(__name__) +app.config.from_object("default_settings") +app.register_blueprint(main) + +# db +db.init_app(app) +db.app = app +db.create_all() + +# mail +mail.init_app(app) + +def main(): + app.run(host="0.0.0.0", debug=True) + +if __name__ == '__main__': + main() -- cgit v1.1