如何启动django cms项目

boo*_*kah 3 python django django-cms

我决定去看看django-cms.在查看文档后,我使用了克隆存储库

git clone https://github.com/divio/django-cms.git
Run Code Online (Sandbox Code Playgroud)

然后我用它安装它

sudo python setup.py install
Run Code Online (Sandbox Code Playgroud)

我已经安装了django 1.2.3.我移动到了example一个syncdb创建以下表的运行目录:

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 auth_message
Creating table django_content_type
Creating table django_session
Creating table django_admin_log
Creating table django_site
Creating table sampleapp_category
Creating table sampleapp_picture
Creating table south_migrationhistory



You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes...
Run Code Online (Sandbox Code Playgroud)

我们可以清楚地看到没有创建cms表.在运行服务器和浏览时,我显然遇到了这个问题http://localhost:8000/

DatabaseError: no such table: cms_page
Run Code Online (Sandbox Code Playgroud)

我查看了文档并看到我满足了有关版本的要求但很明显,我做错了.任何帮助将不胜感激.

Ben*_*end 7

django-cms使用South进行数据库迁移.由South处理的模型不会使用同步到数据库syncdb.你必须使用manage.py migrate.

由于您没有来自django-cms的任何表和数据要迁移,因此更快的解决方案是此过程:

  • 'south'在你的评论中注释掉INSTALLED_APPS
  • 运行manage.py syncdb(这将创建来自django-cms的所有表)
  • 重启你的南方 INSTALLED_APPS
  • manage.py migrate --fake

下次更新django-cms时,可以运行manage.py migrate以更新数据库表.