Django 1.9 deprecation warnings app_label

后端 未结 12 742
花落未央
花落未央 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:24

    Add a meta class to your model with an app_label attribute.

    class Meta:
        app_label = 'app_model_belongs_to'
    

    Hope this works!

    EDIT: The reason for this is usually that the model exists outside of the standard locations.

    For more information refer to: https://docs.djangoproject.com/en/1.8/ref/models/options/#app-label

提交回复
热议问题