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 <<> when I enter it in terminal :

  Python manage.py shell -        

I get an error:

  Increase KeyError Key key: 'SECRET_KEY'  

Help me, I'm using DNS and

I'm trying this locally, and in your environment,

Code> SECRET_KEY is not setup

set it using Export SECRET_KEY = "somesecretvalue"

and then python manage.py shell - Settings = Entri.settings.prod should work fine.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -