Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use random secret key instead of hardcoding it #69

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions apis_acdhch_default_settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
from typing import Any, Dict

from django.core.management.utils import get_random_secret_key
import dj_database_url

if os.environ.get("SENTRY_DSN"):
Expand All @@ -22,10 +23,7 @@
send_default_pii=True,
)

# We fall back to a DEFAULT_SECRET_KEY, but you should
# override this using an environment variable!
DEFAULT_SECRET_KEY = "a+nkut46lzzg_=ul)zrs29$u_6^*)2by2mjmwn)tqlgw)_at&l"
SECRET_KEY = os.environ.get("SECRET_KEY", DEFAULT_SECRET_KEY)
SECRET_KEY = os.environ.get("SECRET_KEY", get_random_secret_key())

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(
Expand Down