Skip to content

Put django secret key in .env #254

@FelixFrizzy

Description

@FelixFrizzy

python secret key should be put in .env (for usability reasons)
Therefore, something like
SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', 'django-insecure-_91@mjc8g-&q_f9io$jmicovci2bilh#)ud3$^iqhj1wnccr%t') should be added to settings.py

and a DJANGO_SECRET_KEY = to .example.env accordingly.

The issue is that certain characters (.e.g $ and #) are not escaped and break the read process of the .env file. Putting everything explicitly as str did also not help (.e.g str(os.getenv...) or DJANGO_SECRET_KEY=str(...)).

Also related to #241

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions