mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2025-01-07 00:24:16 +01:00
38 lines
978 B
Python
38 lines
978 B
Python
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')
|
|
SQLALCHEMY_RECORD_QUERIES = True
|
|
|
|
ADMINS = ['you@example.com']
|
|
|
|
|
|
class Config(object):
|
|
DEBUG = False
|
|
TESTING = 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):
|
|
TESTING = True
|