To solve the Django model “doesn’t declare an explicit app_label”. It took me a long time to realise that I had an init.py in the same directory as the
Have you forgotten to include your application’s name in the settings file? The default class generated by the
.manage.py createapp myAppName command at apps.py is
myAppName is your app’s name.
Make sure that you have added
'django.contrib.sites' to the installed apps and also refer the below solution.
INSTALLED_APPS = [ 'myAppName.apps.myAppNameConfig', 'django.contrib.admin', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.staticfiles', 'django.contrib.messages' ]
The settings file learns what you wish to call your programme this way. Later, in the apps.py file, you can change how it looks by adding the following code.
class myAppNameConfig(AppConfig): name = 'myAppName' verbose_name = 'A good Name'
ImportError: No module named ‘exceptions’