Sunday, February 27, 2022

The SECRET_KEY setting must not be empty - os.environ.get('SECRET_KEY')

On W10 I defined an environment variable: SECRET_KEY
In shell I can read the key:

>>> import os
>>> os.environ.get('SECRET_KEY')

But when I'm doing the same thing in I get:

\lib\site-packages\django\conf\", line 90, in __getattr__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

I found all sorts of solutions, but none works for my app. What should I do?

Thank you!

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment