I was sourcing .env through my shell, which, I suspect, is a non-standard behavior, because this struck me as a bug:
DJANGO_SECRET_KEY=string
along with all the other variables are not quoted with single-apostrophe ticks '
... which means that if there are characters that can be shell-evaluated, they will be. This also affects urls because of the &
that may be possible in their strings, as well as other shell characters.
Shouldn't it be
DJANGO_SECRET_KEY='string'
?
Or am I doing it wrong .env never gets sourced by a shell?
The .env file is read by the package django-environ and bears no relationship to either the python or shell formatting, it literally wants
<key>=<value>
.