diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2011-09-09 21:21:37 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2011-09-09 21:21:37 +0200 |
| commit | ef353d643c274d19e7816e9cfa436e38f1d1edea (patch) | |
| tree | ce88603d11ed7b10015677db1ce97ad3cf23ec4e /budget/run.py | |
| parent | 45dc6edacbc9cb771fd038cdc719fd953c1a6771 (diff) | |
| download | ihatemoney-mirror-ef353d643c274d19e7816e9cfa436e38f1d1edea.zip ihatemoney-mirror-ef353d643c274d19e7816e9cfa436e38f1d1edea.tar.gz ihatemoney-mirror-ef353d643c274d19e7816e9cfa436e38f1d1edea.tar.bz2 | |
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.
Diffstat (limited to 'budget/run.py')
| -rw-r--r-- | budget/run.py | 22 |
1 files changed, 22 insertions, 0 deletions
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() |
