python - getting raise KeyError(key) KeyError: 'SECRET_KEY' with django on production settings -
I have 2 separate settings for output and development files and a common base.py settings file
Base.py
SECRET_KEY = R "! @ # $% ^ & Amp; 123456" prod.py
.base import from * SECRET_KEY = os.environment ['SECRET_KEY'] manage.py From the Denggo __name__ == "__main__": os.environ.setdefault ("DJANGO_SETTINGS_MODULE", "project.settings.dev") p <<> I get an error: Help me, I'm using DNS and I'm trying this locally, and in your environment, Code> SECRET_KEY when I enter it in terminal : is not setup
Python manage.py shell -
Increase KeyError Key key: 'SECRET_KEY'
set it using Export SECRET_KEY = "somesecretvalue" and then python manage.py shell - Settings = Entri.settings.prod should work fine.
Comments
Post a Comment