Fresh Django Server, added by Zinnia for the project according to official documents, does not work. A lot of details inside

The server is the Ubuntu virtual machine that I configure today, in accordance with these directions / notes (I took notes where I deviated from the tutorial):

https://www.evernote.com/shard/s50/sh/5c4f5ed1-bdb0-40c1-b9de-39fae702d709/d906be4f255c36241a3b76bf6fc7e7b7

It got Django "It worked!" to the server address on the local network. Then I followed the instructions on the official website (I can’t post too many links, my reputation is too low) and when I tried to execute. /manage.py syncdb, I get the following error:

CommandError: One or more models did not validate:
zinnia.entry: 'sites' has an m2m relation with model <class 'django.contrib.sites.models.Site'>, which has either not been installed or is abstract.

The Zinnia URLs (/ weblog / and / comments /) show 404 errors indicating that the Zinnia URLs that are definitely in the urls.py project are not pulling it out of urls.py. I suspect the syncdb error has something to do with this:

Using the URLconf defined in homepage.urls, Django tried these URL patterns, in this order:
    ^admin/
The current URL, weblog/, didn't match any of these.

To be explicit, starting with a working Django server, I did the following, as directed (I repeat the steps I took to fully understand):

  • $ pip install django-blog-zinnia
  • added "tagging", "mptt", "zinnia" to installed applications in settings.py
  • also added TEMPLATE_CONTEXT_PROCESSORS to settings.py

, python - Zinnia ? , , , .txt, , . , Zinnia, .

+4
1

, . , django.contrib, django.contrib.sites, , .

.

EDIT:

INSTALLED_APPS , , :

 INSTALLED_APPS = (
  'django.contrib.auth',
  'django.contrib.admin',
  'django.contrib.sites', # Note this one is not included by default
  'django.contrib.comments', # Note this one is not included by default
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  'django.contrib.contenttypes',
  'tagging',
  'mptt',
  'zinnia',
)

, , , SITE_ID.

SITE_ID = 1

.

2:

Django 1.6 django.contrib.comments : django_comments.

'django_comments' INSTALLED_APPS ( 'django.contrib.comments').

+4

Source: https://habr.com/ru/post/1537584/


All Articles