2

This is my code in my signals.py

from .models import Entry

@receiver(pre_save, sender=Entry)
def do_stuff(sender, instance, *args, **kwargs):
    pass

Now this questions is related

Django 1.9 deprecation warnings app_label

But I am not able to figure out why I need to create extra class for that.

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.

If I just empty my signals file then there is no warning. The issue is using .models in signals as mentioned in that question

Community
  • 1
  • 1
user3214546
  • 6,523
  • 13
  • 51
  • 98

2 Answers2

0

This is mostly likely because your application is not in the INSTALLED_APPS within your settings.py

0

I also got this error, what I found the error is in model import before it exist.

I used this to import model and it works for me

from django.apps import apps
model_obj = apps.get_model('app_name', 'model_name')
model_obj.objects.get() ...etc
Dilraj
  • 2,791
  • 2
  • 15
  • 9