Error with Django-blog-Zinnia users model

Asked

Viewed 39 times

-1

I created a project from scratch with the cookiecutter-Django, using version 1.9.9, since in documentation of the Django-blog-Zinnia package it is recommended to use Django < 2.0.

To use version 1.9.9 I simply downloaded the cookiecutter-Django on my computer, entered the folder and changed the version:

git checkout 1.9.9

I followed the installation script and the project worked normally. HOWEVER, by adding Zinnia according to the documentation, changing the file config/settings/common.py

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

TEMPLATES = [
  {
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'APP_DIRS': True,
    'OPTIONS': {
      'context_processors': [
        'django.contrib.auth.context_processors.auth',
        'django.template.context_processors.i18n',
        'django.template.context_processors.request',
        'django.contrib.messages.context_processors.messages',
        'zinnia.context_processors.version',  # Optional
      ]
    }
  }
]

and the file config/urls.py

from django.conf.urls import include
from django.conf.urls import url

url(r'^weblog/', include('zinnia.urls')),
url(r'^comments/', include('django_comments.urls')),

when trying to migrate the database with

python manage.py migrate

I’m getting the following error:

Lookuperror: Model 'users. User' not Registered.

How to fix and install Zinnia in the project?

1 answer

-1

I believe you should set up the AUTH_USER_MODEL in his config/settings/common.py:

AUTH_USER_MODEL = 'User.user'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.