getting raise KeyError(key) KeyError: 'SECRET_KEY' with django on production settings

后端 未结 2 1711
长情又很酷
长情又很酷 2021-02-20 07:10

I\'ve 2 separate settings files for production and development and a common base.py settings file
base.py

SECRET_KEY = r\"!@#$%^&12345         


        
2条回答
  •  梦毁少年i
    2021-02-20 07:44

    I think you are trying this locally, and don't have the SECRET_KEY setup in your environment.

    Set it using

    export SECRET_KEY="somesecretvalue"
    

    and then running python manage.py shell --settings=entri.settings.prod should work fine.

提交回复
热议问题