From 344f6e6142fee062db52baecb4559e6fe2888c79 Mon Sep 17 00:00:00 2001 From: Chris Reeves Date: Tue, 8 Oct 2013 19:02:31 +0100 Subject: [PATCH] Flasky things --- .gitignore | 2 +- src/foo/config.py | 2 ++ src/foo/run.py | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 src/foo/config.py diff --git a/.gitignore b/.gitignore index 96c54ca..c56bbd0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ .vagrant -.pyc +*.pyc diff --git a/src/foo/config.py b/src/foo/config.py new file mode 100644 index 0000000..7174375 --- /dev/null +++ b/src/foo/config.py @@ -0,0 +1,2 @@ +DEBUG = True +TESTING = False diff --git a/src/foo/run.py b/src/foo/run.py index 3a7d241..637ca45 100644 --- a/src/foo/run.py +++ b/src/foo/run.py @@ -1,5 +1,5 @@ from flask import Flask -app = Flask(__name__) +app = Flask('foo') @app.route('/') @@ -8,9 +8,12 @@ def hello_world(): if __name__ == '__main__': + app.config.from_object('foo.config') # Default + kwargs = {} kwargs.update({ 'host': '0.0.0.0', 'port': 8080 }) + app.run(**kwargs)