我有一个使用django的服务器。我正在尝试将数据库从sqlite3切换到mysql。之前sqlite3的一切都很好。但是,当我使用mysql时

python manage.py syncdb

我没有得到任何错误,但models.py中指定的表没有创建。仅创建以下表:
[ec2-user@domU-12-31-39-0F-D2-F3 prototype]$ python manage.py syncdb
Syncing...
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table south_migrationhistory

有人知道为什么吗?

最佳答案

你好像在用南方。通常情况下,South会禁止在syncdb中创建大多数表,您需要运行South迁移来第一次创建它们。这使得South可以跟踪表的状态并应用任何特殊的迁移规则,即使是在最初。
另一种可能是您的设置文件中的INSTALLED_APPS变量中没有列出所有应用程序。

10-08 07:22