Have gone through
Django 1.9 deprecation warnings app_label
but answers couldn't fix my problem, so asking again.
I have an app that is added to INSTALLED_APPS in settings.
when ever I run
[trimmed path to project]/catalog/models.py:9: RemovedInDjango19Warning: Model class catalog.models.Category 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.
from django.db.models.signals import post_save
from django.dispatch import receiver
from models import Category
def someSignal(sender, **kwargs):
from django.apps import AppConfig
name = 'catalog'
verbose_name = 'Catalogue'
default_app_config = 'catalog.apps.WhosConfig'
You are importing models.py before app configuration run.
To fix it, you could import and configure signals in
def someSignal(sender, **kwargs): pass
from django.apps import AppConfig from django.db.models.signals import post_save class CatalogConfig(AppConfig): name = 'catalog' verbose_name = 'Catalogue' def ready(self): from .signals import someSignal post_save.connect( receiver=someSignal, sender=self.get_model('Category') )
you may want to check ready method in documentation