Skip to content

Commit

Permalink
fix random cookie secret
Browse files Browse the repository at this point in the history
  • Loading branch information
morganekmefjord committed Dec 12, 2024
1 parent 17544d1 commit 9338bd9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ptp/ptp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
BASE_DIR = Path(__file__).resolve().parent.parent

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ptp_for_president_CC44aAFG'
import random
SECRET_KEY = os.environ.get('SECRET_KEY', ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]))

# SECURITY WARNING: don't run with debug turned on in production!

#DEBUG = True
if os.environ.get('DEBUG', False) == 'True':
DEBUG = True

else:
DEBUG = False

ALLOWED_HOSTS = ['*', 'localhost']

Expand Down

0 comments on commit 9338bd9

Please sign in to comment.