Django model "doesn't declare an explicit app_label"
I'm at wit's end. After a dozen hours of troubleshooting, probably more, I thought I was finally in business, but then I got:
Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label
There is SO LITTLE info on this on the web, and no solution out there has resolved my issue. Any advice would be tremendously appreciated.
I'm using Python 3.4 and Django 1.10.
From my settings.py:
INSTALLED_APPS = [ 'DeleteNote.apps.DeletenoteConfig', 'LibrarySync.apps.LibrarysyncConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ]
And my apps.py files look like this:
from django.apps import AppConfig class DeletenoteConfig(AppConfig): name = 'DeleteNote'
from django.apps import AppConfig class LibrarysyncConfig(AppConfig): name = 'LibrarySync'
Are you missing putting in your application name into the settings file? The
myAppNameConfig is the default class generated at apps.py by the .manage.py createapp myAppName command. Where myAppName is the name of your app.
INSTALLED_APPS = [ 'myAppName.apps.myAppNameConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ]
This way, the settings file finds out what you want to call your application. You can change how it looks later in the apps.py file by adding the following code in
class myAppNameConfig(AppConfig): name = 'myAppName' verbose_name = 'A Much Better Name'
★ Back to homepage or read more recommendations: