3 basedir = os.path.abspath(os.path.dirname(__file__))
5 # SQLAlchemy connection string
6 SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'state', 'database.db')
8 # CSRF protection: generate a CSRF secret key if none exists
10 csrf_keyfile = os.path.join(basedir, 'state', 'csrf_secret')
11 if not os.path.exists(csrf_keyfile):
12 with open("/dev/urandom") as rng:
14 with open(csrf_keyfile, "w") as f:
17 with open(csrf_keyfile) as f: