From e23c51122368d9b7320743cf1b32b3592506c6d6 Mon Sep 17 00:00:00 2001 From: Rich Ranallo Date: Sat, 24 Sep 2016 18:55:32 -0500 Subject: [PATCH 1/5] added compose variable --- README.md | 2 +- app.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d8e2944..f993041 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Want to see some GIFs generated by JIFBOX? Check out Sunlight Foundation's [Sunf ## Deploy -[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/sunlightlabs/jifbox) +[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/polisurgist/jifbox) Click the button above to deploy on a new [Heroku](https://heroku.com) instance. You will be prompted for [configuration values](#environment-variables). diff --git a/app.json b/app.json index 7a7f9c2..bc12689 100644 --- a/app.json +++ b/app.json @@ -38,6 +38,6 @@ } }, "addons": [ - "mongohq:sandbox" + "mongohq:ssd_1g_elastic" ] } \ No newline at end of file From 054f3269895bd929a074f3aeb467299af5a9d734 Mon Sep 17 00:00:00 2001 From: Rich Ranallo Date: Sat, 24 Sep 2016 19:18:36 -0500 Subject: [PATCH 2/5] changed mongo env var name --- web.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web.py b/web.py index a1963f1..e6f2831 100644 --- a/web.py +++ b/web.py @@ -33,9 +33,11 @@ # MongoDB configuration # -mongo_url = os.environ.get('MONGOLAB_URI') +mongo_url = os.environ.get('MONGOHQ_URL') mongo_conn = MongoClient(mongo_url) +print(mongo_url) + mongo_params = urlparse(mongo_url) mongo = mongo_conn[mongo_params.path.strip('/')] From 97ac98cc4d375783e9f0613b28c7dbb7618fb1dc Mon Sep 17 00:00:00 2001 From: Rich Ranallo Date: Sat, 24 Sep 2016 19:31:25 -0500 Subject: [PATCH 3/5] removed dumb print statement --- web.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/web.py b/web.py index e6f2831..6b9e164 100644 --- a/web.py +++ b/web.py @@ -36,8 +36,6 @@ mongo_url = os.environ.get('MONGOHQ_URL') mongo_conn = MongoClient(mongo_url) -print(mongo_url) - mongo_params = urlparse(mongo_url) mongo = mongo_conn[mongo_params.path.strip('/')] From 70ea1a45388d195cf1f8e5875dfce00ca5e98cf1 Mon Sep 17 00:00:00 2001 From: Rich Ranallo Date: Sat, 24 Sep 2016 19:51:39 -0500 Subject: [PATCH 4/5] pulling tumblr hostname for post-photo notice in from environment instead of hardcoding --- .env.example | 4 ++-- templates/jifbox.html | 2 +- web.py | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 39b47d9..bc1c5cb 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,6 @@ export DROPBOX_SECRET=https://www.dropbox.com/developers export TUMBLR_KEY=youllgetthisfromtuble export TUMBLR_SECRET=https://www.tumblr.com/docs/en/api/v2 export TUMBLR_HOSTNAME=whereeveryouwanttohost.tumblr.com -export MONGOLAB_URI=youllgetthisfromherokuaddonsifyouwantto +export MONGOHQ_URL=youllgetthisfromherokuaddonsifyouwantto -echo success! \ No newline at end of file +echo success!! \ No newline at end of file diff --git a/templates/jifbox.html b/templates/jifbox.html index 2d743eb..5b29200 100644 --- a/templates/jifbox.html +++ b/templates/jifbox.html @@ -39,7 +39,7 @@ diff --git a/web.py b/web.py index 6b9e164..6d01178 100644 --- a/web.py +++ b/web.py @@ -22,6 +22,7 @@ SECRET_KEY = os.environ.get('SECRET_KEY') + DEFAULT_SETTINGS = { 'frame_delay': 255, 'frames': 10, @@ -43,6 +44,7 @@ if mongo_params.username and mongo_params.password: mongo.authenticate(mongo_params.username, mongo_params.password) +tumblr_host = os.environ.get('TUMBLR_HOSTNAME') # # services @@ -309,7 +311,8 @@ def logout(): @app.route('/') @login_maybe_required def index(): - return render_template('jifbox.html') + context = {'tumblr_host': tumblr_host} + return render_template('jifbox.html' **context) @app.route('/giffed', methods=['POST']) From 5a40ee9ec713d0169ee205cd61b0874e74b53380 Mon Sep 17 00:00:00 2001 From: Rich Ranallo Date: Sat, 24 Sep 2016 19:55:40 -0500 Subject: [PATCH 5/5] god damn comma --- web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web.py b/web.py index 6d01178..b709438 100644 --- a/web.py +++ b/web.py @@ -312,7 +312,7 @@ def logout(): @login_maybe_required def index(): context = {'tumblr_host': tumblr_host} - return render_template('jifbox.html' **context) + return render_template('jifbox.html', **context) @app.route('/giffed', methods=['POST'])