From 21d94dc626152b693006c1f6b2cfee9472a7e180 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 18 Nov 2018 11:36:20 +0100 Subject: [PATCH] Auto-generate a secret key for development mode. --- xppl/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xppl/config.py b/xppl/config.py index 85324cb..acc3e0c 100644 --- a/xppl/config.py +++ b/xppl/config.py @@ -1,5 +1,6 @@ """The Application settings.""" +from os import environ, urandom from os.path import abspath, dirname, isdir, join @@ -30,3 +31,7 @@ class Development(Base): DEBUG = True TESTING = True DOMAIN = 'http://localhost' + SECRET_KEY = environ.get( + 'XPPL_SECRET_KEY', + urandom(24).hex() + )