config: generate secret key using python

stable
neingeist 6 years ago
parent 0007a057a3
commit 0dacb730a9

@ -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

Loading…
Cancel
Save