Django model “doesn't declare an explicit app_label”

后端 未结 28 1917
無奈伤痛
無奈伤痛 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:05

    I had the same problem just now. I've fixed mine by adding a namespace on the app name. Hope someone find this helpful.

    apps.py

    from django.apps import AppConfig    
    
    class SalesClientConfig(AppConfig):
            name = 'portal.sales_client'
            verbose_name = 'Sales Client'
    

提交回复
热议问题