在Django中运行迁移时出现InvalidBasesError

时间:2015-05-15 02:42:16

标签: django django-cms django-migrations

我正在尝试发现django-cms。

我做了一个新项目(these steps之后)。但是当我做mime时,我会遇到以下问题:

django migrate

这是我的INSTALLED_APPS:

>>>python manage.py migrate
Operations to perform:
  Synchronize unmigrated apps: treebeard, menus, sekizai, cms, djangocms_admin_style
  Apply all migrations: sessions, reversion, auth, admin, contenttypes, sites, djangocms_picture
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying djangocms_picture.0001_initial...Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/db/migrations/executor.py", line 68, in migrate
    self.apply_migration(migration, fake=fake)
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/db/migrations/executor.py", line 96, in apply_migration
    if self.detect_soft_applied(migration):
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/db/migrations/executor.py", line 140, in detect_soft_applied
    apps = project_state.render()
  File "/home/vmonteco/.Envs/django-cms/lib/python3.4/site-packages/django/db/migrations/state.py", line 75, in render
    "for more" % new_unrendered_models
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<ModelState: 'cms.PageUser'>, <ModelState: 'cms.PageUserGroup'>]
This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth)
 in an app with no migrations; see https://docs.djangoproject.com/en/1.7/topics/migrations/#dependencies for more

当我取消注释最后一行时,会发生此错误。为什么? 我怎么能解决这个问题?

1 个答案:

答案 0 :(得分:3)

我找到了解决方案here

您必须在项目设置中更改MIGRATION_MODULES,从某些值中删除_django。链接的网页提及cmsmenus,但我必须将其从djangocms_linkdjangocms_text_ckeditor中移除。