我在AWS中安装了应用程序并创建了一个新的数据库。
我运行了python manage.py migrate
但低于错误发生。
我使用mysql。我不知道架构中有什么改变。
请帮帮我。
INSTALLED_APPS = [
'cms',
'treebeard',
'menus',
'sekizai',
'djangocms_admin_style',
'fluent_dashboard',
'admin_tools',
'admin_tools.menu',
'admin_tools.theming',
'admin_tools.dashboard',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'rest_framework',
]
ValueError:找到错误的cms_page约束数(0)(publisher_is_draft,application_namespace)
Operations to perform:
Apply all migrations: menus, cms, admin, menu, contenttypes, sessions, currency, auth, dashboard, sites
Running migrations:
Rendering model states... DONE
Applying cms.0008_auto_20150121_0059...Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 200, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/migrations/executor.py", line 92, in migrate
self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/migrations/executor.py", line 121, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/migrations/executor.py", line 198, in apply_migration
state = migration.apply(state, schema_editor)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/migrations/migration.py", line 123, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/migrations/operations/models.py", line 359, in database_forwards
getattr(new_model._meta, self.option_name, set()),
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 318, in alter_unique_together
self._delete_composed_index(model, fields, {'unique': True}, self.sql_delete_unique)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/backends/mysql/schema.py", line 87, in _delete_composed_index
return super(DatabaseSchemaEditor, self)._delete_composed_index(model, fields, *args)
File "/var/www/apps/currency_a1/venv/local/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 347, in _delete_composed_index
", ".join(columns),
ValueError: Found wrong number (0) of constraints for cms_page(publisher_is_draft, application_namespace)
冷冻
amqp==1.4.9
anyjson==0.3.3
APScheduler==3.1.0
beautifulsoup4==4.4.1
billiard==3.3.0.23
celery==3.1.23
configparser==3.5.0b2
dashboardmods==1.0
DateTime==4.1.1
dj-database-url==0.4.1
Django==1.9.6
django-admin-tools==0.7.2
django-celery==3.1.17
django-classy-tags==0.7.2
django-cms==3.3.0
django-cors-headers==1.1.0
django-filter==0.13.0
django-fluent-dashboard==0.6.1
django-formtools==1.0
django-markup==1.1
django-mptt==0.8.4
django-sekizai==0.9.0
django-staff-toolbar==1.0.1
django-treebeard==4.0.1
djangocms-admin-style==1.2.2
djangocms-installer==0.8.9
djangorestframework==3.3.3
djangorestframework-apidoc==0.0.1
feedparser==5.2.1
future==0.15.2
gunicorn==19.6.0
html5lib==0.9999999
kombu==3.0.35
Markdown==2.6.6
Menus==0.1.7
mysqlclient==1.3.7
pbr==1.9.1
publicsuffix==1.1.0
Pygments==2.1.3
pytz==2016.4
requests==2.10.0
setproctitle==1.1.10
six==1.10.0
South==1.0.2
SQLAlchemy==1.0.13
stevedore==1.13.0
tzlocal==1.2.2
Unidecode==0.4.19
url==0.2.0
uWSGI==2.0.13.1
virtualenv==15.0.1
virtualenv-clone==0.2.6
virtualenvwrapper==4.7.1
zope.interface==4.1.3
答案 0 :(得分:0)
我确实喜欢“python manage.py migrate --fake”
到目前为止,它似乎已完成迁移。
似乎--fake选项是在模块中传递旧操作,以便新安装不受旧安装影响,只需安装新安装。
但是,在这种情况下,不会为cms创建架构。 - 假选项不是解决方案。是否有人通过了?
执行的操作: 应用所有迁移:菜单,菜单,管理员,货币,身份验证,仪表板,cms,内容类型,网站,会话
Running migrations:
Rendering model states... DONE
Applying cms.0008_auto_20150121_0059... FAKED
Applying cms.0009_merge... FAKED
Applying cms.0010_migrate_use_structure... FAKED
Applying cms.0011_auto_20150419_1006... FAKED
Applying cms.0012_auto_20150607_2207... FAKED
Applying cms.0013_urlconfrevision... FAKED
Applying cms.0014_auto_20160404_1908... FAKED
Applying cms.0015_auto_20160421_0000... FAKED
python manage.py migrate
Operations to perform:
Apply all migrations: dashboard, sessions, menus, currency, cms, auth, contenttypes, menu, admin, sites
Running migrations:
最后,我运行了“python manage.py managa.py cms --run-syncdb”。 完成此操作后,将创建0008_auto_20150121_0059.py的下一个内容。