Issue
After a dozen hours of troubleshooting, 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.
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'
and
from django.apps import AppConfig
class LibrarysyncConfig(AppConfig):
name = 'LibrarySync'
Solution
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.
settings.py
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
myAppName/apps.py
class myAppNameConfig(AppConfig):
name = 'myAppName'
verbose_name = 'A Much Better Name'
Answered By - Xeberdee
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.