From 0dacb730a9d2251f4c0cab4cf013b97d6045b1f5 Mon Sep 17 00:00:00 2001 From: neingeist Date: Sun, 11 Nov 2018 17:09:42 +0100 Subject: [PATCH] config: generate secret key using python --- config.py.example | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config.py.example b/config.py.example index e866536..87eaa6f 100644 --- a/config.py.example +++ b/config.py.example @@ -1,7 +1,8 @@ -import os -import subprocess +import os, random, string + class Config: - SECRET_KEY = os.environ.get('SECRET_KEY') or subprocess.check_output(['pwgen', '20', '1']) + SECRET_KEY = os.environ.get('SECRET_KEY') or \ + ''.join(random.choices(string.ascii_letters, k=20)) DATA_DIR = os.environ.get('DATA_DIR') or '/home/orange/devel/prolefeeder/tmp' MAX_LENGTH = os.environ.get('MAX_LENGTH') or 180