Django model “doesn't declare an explicit app_label”

后端 未结 28 1901
無奈伤痛
無奈伤痛 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 15:54

    For PyCharm users: I had an error using not "clean" project structure.

    Was:

    project_root_directory
    └── src
        ├── chat
        │   ├── migrations
        │   └── templates
        ├── django_channels
        └── templates
    

    Now:

    project_root_directory
    ├── chat
    │   ├── migrations
    │   └── templates
    │       └── chat
    ├── django_channels
    └── templates
    

    Here is a lot of good solutions, but I think, first of all, you should clean your project structure or tune PyCharm Django settings before setting DJANGO_SETTINGS_MODULE variables and so on.

    Hope it'll help someone. Cheers.

提交回复
热议问题