diff --git a/Procfile b/Procfile deleted file mode 100644 index 5d8784f8d..000000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: gunicorn manage:app diff --git a/config.py b/config.py index 6ef462962..abb5a8442 100644 --- a/config.py +++ b/config.py @@ -85,11 +85,25 @@ def init_app(cls, app): app.logger.addHandler(file_handler) +class UnixConfig(ProductionConfig): + @classmethod + def init_app(cls, app): + ProductionConfig.init_app(app) + + # log to syslog + import logging + from logging.handlers import SysLogHandler + syslog_handler = SysLogHandler() + syslog_handler.setLevel(logging.WARNING) + app.logger.addHandler(syslog_handler) + + config = { 'development': DevelopmentConfig, 'testing': TestingConfig, 'production': ProductionConfig, 'heroku': HerokuConfig, + 'unix': UnixConfig, 'default': DevelopmentConfig } diff --git a/manage.py b/manage.py index 8771a05c0..f049f6c7b 100755 --- a/manage.py +++ b/manage.py @@ -6,6 +6,13 @@ COV = coverage.coverage(branch=True, include='app/*') COV.start() +if os.path.exists('.env'): + print('Importing environment from .env...') + for line in open('.env'): + var = line.strip().split('=') + if len(var) == 2: + os.environ[var[0]] = var[1] + from app import create_app, db from app.models import User, Follow, Role, Permission, Post, Comment from flask.ext.script import Manager, Shell diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index dd29476f5..000000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ --r requirements/prod.txt -Flask-SSLify==0.1.4 -gunicorn==18.0 -psycopg2==2.5.1