2015-04-08 23:12:47 +02:00
|
|
|
import datetime
|
|
|
|
import os
|
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
|
|
|
|
|
|
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')
|
2016-04-24 18:20:03 +02:00
|
|
|
SQLALCHEMY_RECORD_QUERIES = True
|
2015-04-08 23:12:47 +02:00
|
|
|
|
|
|
|
ADMINS = ['you@example.com']
|
|
|
|
|
|
|
|
|
|
|
|
class Config(object):
|
|
|
|
DEBUG = False
|
|
|
|
TESTING = False
|
2016-04-24 18:20:03 +02:00
|
|
|
CSRF_ENABLED = True
|
2015-04-08 23:12:47 +02:00
|
|
|
WTF_CSRF_ENABLED = True
|
|
|
|
SECRET_KEY = 'you-will-never-guess'
|
|
|
|
sessionTimeout = datetime.timedelta(minutes=-2)
|
|
|
|
|
2016-04-24 18:20:03 +02:00
|
|
|
SQLALCHEMY_ECHO = False
|
|
|
|
SQLALCHEMY_DATABASE_URI = SQLALCHEMY_DATABASE_URI
|
|
|
|
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
|
|
|
|
|
2015-04-08 23:12:47 +02:00
|
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
|
|
|
DEBUG = True
|
|
|
|
SQLALCHEMY_ECHO = True
|
2016-04-24 18:20:03 +02:00
|
|
|
SQLALCHEMY_RECORD_QUERIES = True
|
2015-04-08 23:12:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestingConfig(Config):
|
|
|
|
TESTING = True
|