From 43fbaa3c66928420d96080a19370ceebc3977194 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 12 Oct 2015 09:18:17 -0700 Subject: [PATCH] Add heroku config --- Procfile | 2 +- config.py | 8 ++++++++ heroku-run.py | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 heroku-run.py diff --git a/Procfile b/Procfile index b15858e..5cd4f41 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: gunicorn -w 4 manage:app --log-file=- +web: gunicorn -w 4 heroku-run:app --log-file=- init: python manage.py initdb diff --git a/config.py b/config.py index 0e41ae1..132a773 100644 --- a/config.py +++ b/config.py @@ -23,8 +23,16 @@ class DevelopmentConfig(Config): 'postgres://matthew@localhost/akindices' +class HerokuConfig(Config): + DEBUG = False + TITLE = 'AKIndices' + SECRET_KEY = os.environ.get('SECRET_KEY') or 'top secret' + SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') + + config = { 'development': DevelopmentConfig, + 'heroku': HerokuConfig, 'default': DevelopmentConfig } diff --git a/heroku-run.py b/heroku-run.py new file mode 100644 index 0000000..bb5b11b --- /dev/null +++ b/heroku-run.py @@ -0,0 +1,6 @@ +from app import create_app + +app = create_app('heroku') + +if __name__ == "__main__": + app.run()