Django CMS Неизвестный столбец 'djangocms_picture_picture.use_responsive_image' в 'списке полей - PullRequest
0 голосов
/ 12 декабря 2018

Пожалуйста, найдите ниже полный traceback.Это происходит, когда я пытаюсь опубликовать страницу через портал django cms.Попытался выполнить миграцию: python manage.py перенести djangocms_picture, но он не работает.

>     Traceback (most recent call last):
>       File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py",
> line 132, in get_response
>         response = wrapped_callback(request, *callback_args, **callback_kwargs)
>       File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py",
> line 110, in _wrapped_view
>         response = view_func(request, *args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py",
> line 57, in _wrapped_view_func
>         response = view_func(request, *args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py",
> line 233, in inner
>         return view(request, *args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py",
> line 34, in _wrapper
>         return bound_func(*args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/django/views/decorators/http.py",
> line 45, in inner
>         return func(request, *args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py",
> line 30, in bound_func
>         return func.__get__(self, type(self))(*args2, **kwargs2)
>       File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py",
> line 145, in inner
>         return func(*args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/cms/admin/pageadmin.py", line
> 1091, in publish_page
>         all_published = page.publish(language)
>       File "/usr/local/lib/python2.7/site-packages/cms/models/pagemodel.py", line
> 926, in publish
>         self._copy_contents(public_page, language)
>       File "/usr/local/lib/python2.7/site-packages/cms/models/pagemodel.py", line
> 562, in _copy_contents
>         cleared_placeholders = target._clear_placeholders(language)
>       File "/usr/local/lib/python2.7/site-packages/cms/models/pagemodel.py", line
> 554, in _clear_placeholders
>         models.query.QuerySet.delete(plugins)
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 536, in delete
>         collector.collect(del_query)
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/deletion.py",
> line 228, in collect
>         elif sub_objs:
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 170, in __nonzero__
>         return type(self).__bool__(self)
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 166, in __bool__
>         self._fetch_all()
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 965, in _fetch_all
>         self._result_cache = list(self.iterator())
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 238, in iterator
>         results = compiler.execute_sql()
>       File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 840, in execute_sql
>         cursor.execute(sql, params)
>       File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py",
> line 64, in execute
>         return self.cursor.execute(sql, params)
>       File "/usr/local/lib/python2.7/site-packages/django/db/utils.py", line 98,
> in __exit__
>         six.reraise(dj_exc_type, dj_exc_value, traceback)
>       File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py",
> line 64, in execute
>         return self.cursor.execute(sql, params)
>       File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
> line 124, in execute
>         return self.cursor.execute(query, args)
>       File "/usr/local/lib/python2.7/site-packages/newrelic-2.74.0.54/newrelic/hooks/database_dbapi2.py",
> line 22, in execute
>         *args, **kwargs)
>       File "/usr/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205,
> in execute
>         self.errorhandler(self, exc, value)
>       File "/usr/local/lib/python2.7/site-packages/MySQLdb/connections.py", line
> 36, in defaulterrorhandler
>         raise errorclass, errorvalue
>     OperationalError: (1054, "Unknown column 'djangocms_picture_picture.use_responsive_image' in 'field list'")

1 Ответ

0 голосов
/ 13 декабря 2018

Получил проблему,

Это из-за того, что библиотеки django_cms были обновлены в образах докеров при перестройке, так как точная версия не упоминается в dockerfile.привело к обновлению.Это обновление запускает модели ORM, противоречащие столбцам таблицы.

Исправление:

Упоминает фактические версии пакета в Dockerfile.

До исправления:

RUN pip install djangocms-link djangocms-file djangocms-picture djangocms-video djangocms-googlemap djangocms-snippet djangocms-style djangocms-column

После исправления:

RUN pip install -r requirements.txt

requirements.txt
django-classy-tags==0.8.0
django-cms==3.5.2
django-filer==1.3.2
django-formtools==2.1
django-mptt==0.8.7
django-polymorphic==1.3
django-reversion==1.8.5
django-sekizai==0.10.0
django-treebeard==4.3
djangocms-admin-style==1.2.8
djangocms-attributes-field==0.3.0
djangocms-column==1.8.0
djangocms-file==2.0.2
djangocms-googlemap==1.1.1
djangocms-link==2.1.2
djangocms-picture==2.0.6
djangocms-snippet==2.0.0
djangocms-style==2.0.2
djangocms-text-ckeditor==3.6.0
djangocms-video==2.0.4  

Исправлена ​​ошибка.Спасибо!

...