Django model “doesn't declare an explicit app_label”

后端 未结 28 1963
無奈伤痛
無奈伤痛 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条回答
  •  佛祖请我去吃肉
    2020-11-27 16:19

    I got this one when I used ./manage.py shell then I accidentally imported from the root project level directory

    # don't do this
    from project.someapp.someModule import something_using_a_model
    # do this
    from someapp.someModule import something_using_a_model
    
    something_using_a_model()
    

提交回复
热议问题