-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path issues with read_env since 11.0+ #497
Comments
Additional note: if I change
in my |
The issue has to do with the Hashtags ( I'm not sure the best way to fix this - but I'll keep digging. For anyone else at this time - just make sure there are no hashtags in your SECRET_KEY and you should be fine. |
So, after digging around in the code I realized that I could wrap my secret key in quotes and it would render appropriately. However, it didn't used to be this way and in the documentation it doesn't show wrapping the secret key in quotes.
But a temporary workaround is:
|
Hello @hannylicious, Thank you for bringing this issue to our attention. We are currently investigating several issues related to environment variable parsing, especially concerning the Could you please try using the latest version and see if the issue persists? If it does, consider rolling back to version 0.10.0 as a temporary workaround. Your input is invaluable as we try to get to the bottom of this. It seems a few things have slipped through the cracks in our codebase that require immediate attention. Best regards, |
I can confirm this occurs with 11.0, 11.1 and 11.2. I'll see if I can write some tests that show the cases where it's an issue (essentially it's any SECRET_KEY that has a hashtag in it that is not surrounded in quotes) |
Hello, every body, I think I got the similar issue when I want to using django-environ for My little django app. And My django environment is setup with pyenv+poetry on my Arch Linux VM. And I've tried django-environ versions 0.11.2/0.10.0 with this little command python3 settings.py Both verions of django-environ give me the messages:
And how should I do next step? Any guides/tips? Thanks a lot! |
Oh...Sorry I think I have to settinup the right PATH for BASE_DIR... to actually find out where is ".env.test" files. XD |
I'm surprised that it's been over a month and this hasn't been fixed. My CI tests caught this error and it took me about 30 mins to figure out that it was because there was a |
I'm running into this issue as well with a secret key that has a |
Hi @sergeyklay I put together a repo containing a reproducible example of the bug as I'm seeing it! Hope this helps. https://github.com/amstilp/django-environ-issue-497 |
Any news for this problem - it blocks most of out project for update this package |
I have the following in a wsgi.py:
I have this in the settings.py:
In versions prior to 0.11.0 this all worked without issue. In 0.11.0 and above (including the current 11.2) that code is no longer working.
I am getting errors that environment variables are not loaded (such as the SECRET_KEY) which is set in the settings.
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
I have tried updating the wsgi code to this (per the docs):
I updated the settings to the following:
I'm getting the same error: that 'SECRET_KEY' is empty.
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
If I roll back to version 0.10.0 everything goes back to working as expected.
I have tried modifying my code to use each example given in the docs - each resulted in the same error being thrown.
I load my 'SECRET_KEY' in settings immediately following loading the env file:
DJANGO_SECRET_KEY is set in my .env file.
Again, this all worked perfectly prior to 0.11.0 - but I don't see any references to changes to
read_env
in the Changelog.Any ideas?
The text was updated successfully, but these errors were encountered: