1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2025-01-10 15:10:03 +01:00
password-manager-mirror/backend/flask/src/config.py
jokajak fab1d05127 Introduce new flask based python backend
This supports most functionality. Tested the following functionality:
* Create account
* Delete account
* Create a card
* Download offline copy (couldn't log in) - needs work
* Change passphrase
* One time password creation and use
2015-04-20 08:37:48 -04:00

36 lines
814 B
Python

import datetime
import os
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
ADMINS = ['you@example.com']
class Config(object):
DEBUG = False
TESTING = False
SQLALCHEMY_ECHO = False
WTF_CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
sessionTimeout = datetime.timedelta(minutes=-2)
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_ECHO = True
class TestingConfig(Config):
TESTING = True