Django 1.9 deprecation warnings app_label

后端 未结 12 729
花落未央
花落未央 2020-12-01 05:09

I\'ve just updated to Django v1.8, and testing my local setup before updating my project and I\'ve had a deprecation warning that I\'ve never seen before, nor does it make a

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 05:38

    Similar error. In my case the error was:

    RemovedInDjango19Warning: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS or else was imported before its application was loaded. This will no longer be supported in Django 1.9.
    class Site(models.Model):
    

    My solution was:

    Added 'django.contrib.sites' to INSTALLED_APPS

提交回复
热议问题