這是我的代碼在我signals.py
在信號導入模型引起Django的廢棄警告app_label
from .models import Entry
@receiver(pre_save, sender=Entry)
def do_stuff(sender, instance, *args, **kwargs):
pass
現在,這個問題是有關
Django 1.9 deprecation warnings app_label
但我無法弄清楚,爲什麼我需要爲此創建額外的類。
Warning:
Model class app.models.Entry 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.
如果我只是清空我的信號文件,那麼沒有警告。在這個問題
什麼是*確切*警告你得到什麼? –
@LegoStormtroopr我已更新我的問題 – user3214546
我回答了您鏈接到的問題,看看。 –