Fixed problem with env in settings.py and updated README about ALLOWED_HOSTS#42
Fixed problem with env in settings.py and updated README about ALLOWED_HOSTS#42fklemme wants to merge 2 commits intochilli-axe:masterfrom
Conversation
|
i thought |
|
I saw examples where the user configures explicit casting. But I think that will work only to some extend. Ofc, python will be able to handle something like |
|
Okay, I see there is some "smart casting'. Lists need to be handled differently. Let me have another try on this one... |
|
Hmm, so after having a deeper look at smart casting and default values, I'm not even sure anymore if this is something we want to deal with. There are a lot of side effects and pit holes discussed on the django-environ github page. Apparently, these problems became even so dominant that smart scaling will be disabled in upcoming releases by default [1]. I agree that the code in this PR is not looking as smooth as the previous solution, but seeing the possible misinterpretations, I would consider it solving it as proposed for now. Edit: Maybe one last note, because it might not have been clear in the description: The current implementation of |
A couple of improvements from user feedback on discord.
Apparently, environment variables coming from
envare string by default and not automatically cast to higher-level types such as lists. To ensure correct behavior, I rewrote theenvlines insettings.pyto only depend on strings.I also added a small note on
DJANGO_ALLOWED_HOSTSto the README as it caused some trouble in a setup.