Skip to content

Commit

Permalink
Fix config to pass in variables properly
Browse files Browse the repository at this point in the history
  • Loading branch information
jokajak committed Apr 24, 2016
1 parent a794e5e commit e9b5279
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions backend/flask/src/config.py
Expand Up @@ -3,32 +3,34 @@
basedir = os.path.abspath(os.path.dirname(__file__))


CSRF_ENABLED = True


if os.environ.get('DATABASE_URL') is None:
SQLALCHEMY_DATABASE_URI = ('sqlite:///' + os.path.join(basedir, 'app.db') +
'?check_same_thread=False')
else:
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
SQLALCHEMY_RECRD_QUERIES = True
SQLALCHEMY_RECORD_QUERIES = True

ADMINS = ['you@example.com']


class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_ECHO = False
CSRF_ENABLED = True
WTF_CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
sessionTimeout = datetime.timedelta(minutes=-2)

SQLALCHEMY_ECHO = False
SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE_URI
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')


class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_ECHO = True
SQLALCHEMY_RECORD_QUERIES = True


class TestingConfig(Config):
Expand Down

0 comments on commit e9b5279

Please sign in to comment.