Skip to content

Commit db88df6

Browse files
committed
secret fix
1 parent bae98fe commit db88df6

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.env.example

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# RUNNING_IN_PRODUCTION=1
2121

2222
# Locally set this to a random string
23-
# Remotely set this with the following command:
23+
# LOCAL_SECRET_KEY=123abc
24+
25+
# Production secret key
26+
# Create value with the following command:
2427
# python -c 'import secrets; print(secrets.token_hex())'
25-
# SECRET_KEY=<secret key>
28+
# AZURE_SECRET_KEY=<secret key>

azureproject/development.py

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# SECURITY WARNING: don't run with debug turned on in production!
55
DEBUG = True
66

7+
SECRET_KEY = os.getenv('LOCAL_SECRET_KEY')
8+
79
# Don't use Whitenoise to avoid having to run collectstatic first.
810
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
911

azureproject/production.py

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
DEBUG = False
88
DEBUG_PROPAGATE_EXCEPTIONS = True
99

10+
# SECURITY WARNING: keep the secret key used in production secret!
11+
# Use this py command to create secret
12+
# python -c 'import secrets; print(secrets.token_hex())'
13+
SECRET_KEY = os.getenv('AZURE_SECRET_KEY')
14+
1015
STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
1116

1217
# Configure database connection for Azure PostgreSQL Flexible server instance.

0 commit comments

Comments
 (0)