Tuesday, May 24, 2016

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

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



On Tuesday, 24 May 2016 13:54:04 UTC+1, meInvent bbird wrote:
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',
    'site1.reg.models.Post',
)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/90b5d232-5b69-4c37-8616-afaaaecf978d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment