Django model “doesn't declare an explicit app_label”

后端 未结 28 1964
無奈伤痛
無奈伤痛 2020-11-27 15:38

I\'m at wit\'s end. After a dozen hours of troubleshooting, probably more, I thought I was finally in business, but then I got:

Model class django.contrib.co         


        
28条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 16:14

    I received this error after I moved the SECRET_KEY to pull from an environment variable and forgot to set it when running the application. If you have something like this in your settings.py

    SECRET_KEY = os.getenv('SECRET_KEY')
    

    then make sure you are actually setting the environment variable.

提交回复
热议问题