Skip to content

Commit

Permalink
Replace django get_random_secret_key with secrets.token_hex
Browse files Browse the repository at this point in the history
  • Loading branch information
smartspot2 committed Sep 4, 2024
1 parent 1a9740f commit f1e2119
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ WEB_CONCURRENCY=4" > .env
# Get a new key
echo "Generating Django secret key..."
export SECRET_KEY='temp' # set temporary secret key
export SECRET_KEY=$(python3 csm_web/manage.py shell -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())")
# Note: this secret key doesn't have much cryptographic complexity, but it'll only be used for development
export SECRET_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))")
echo "SECRET_KEY='$SECRET_KEY'" >> .env

# Pull AWS S3 credentials
Expand Down

0 comments on commit f1e2119

Please sign in to comment.