Post doesn't declare an explicit app_label and either isn't in an application in INSTALLED_APPS

6,432 views
Skip to first unread message

meInvent bbird

unread,
May 24, 2016, 8:54:04 AM5/24/16
to Django users
Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.

May 24, 2016 - 05:07:14
Django version 1.8.7, using settings 'site1.settings'
Starting development server at http://127.0.0.1:8081/
Quit the server with CONTROL-C.
/home/martin/Downloads/site1/site1/reg/models.py:30: RemovedInDjango19Warning: Model class site1.reg.models.Post 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.
  class Post(models.Model):

[24/May/2016 05:07:18] "GET /reg/ HTTP/1.1" 200 2260
[24/May/2016 05:07:29] "POST /reg/ HTTP/1.1" 200 2260

after set

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

Paul Martin

unread,
May 24, 2016, 5:37:36 PM5/24/16
to Django users
You've added your Post model to MIDDLEWARE_CLASSES which is incorrect.You need to add your app name containing the post model to INSTALLED_APPS
Reply all
Reply to author
Forward
0 new messages