-
Notifications
You must be signed in to change notification settings - Fork 1
Common issues
Noah S. Roberts edited this page Dec 4, 2024
·
2 revisions
Make sure your 'requirements.txt' file has Whitenoise version 6.8.x in it. Example:
# requirements.txt
whitenoise~=6.8
These can come up if you attempt to get the value of a nonexistent environment variable. If this is expected to happen, set a default value when getting the variable.
env.str('ENV_VARIABLE', default='')
# ^^^^^^^^^^^^You can also quickly set the default of any unset env reads to None by running a regex find and replace in VS Code with the following:
# FIND
(env\.[a-z]+\((('[a-zA-Z_]+')|("[a-zA-Z_]+")))([, default=.*]{0})(\))
# REPLACE
$1, default=None$6If you want a demo of how that works, this breakdown of the regex and this Stack Overflow post might help.
See a term or technology you don't know? The glossary might.