django-проблема с миграцией cms в postgresql Ошибка типа при переносе моделей в postgresql

#django #postgresql #django-cms

#django #postgresql #django-cms

Вопрос:

django-cms : Когда я попытался выполнить python manage.py migrate в postgresql, он возвращает a TypeError , но не выдает никакой ошибки sqlite3 .

Это моя полная трассировка:

 File "manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/cms/migrations/0019_set_pagenode.py", line 68, in apply
    connection.introspection.get_table_description(connection.cursor(), 'cms_page')
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/db/backends/postgresql/introspection.py", line 87, in get_table_description
    )) for line in cursor.description
  File "/home/vagrant/.virtualenvs/pmvp/lib/python3.6/site-packages/django/db/backends/postgresql/introspection.py", line 87, in <listcomp>
    )) for line in cursor.description
TypeError: sequence index must be integer, not 'slice'
 

Кто-нибудь может мне помочь?

Ответ №1:

Это проблема совместимости с psycopg. Ошибка исчезнет после установки более старой версии psycopg2.

установка pip psycopg2==2.7.7

https://github.com/divio/django-cms/issues/6666