我刚刚在 Django 1.4 下将一个站点从 Django-CMS 2.3.5 移动到 2.4.1(在 Stackoverflow的帮助下)。
我现在正在升级到 Django 1.5,这很困难,因为我需要将旧的单独用户配置文件更新为新的自定义用户模型。我遵循了这里的优秀说明,并将所有引用替换User
为settings.AUTH_USER_MODEL
。
不幸的是,Django-CMS 的模型显然仍然引用User
:当我输入 时manage.py runserver
,我收到此错误:
CommandError: One or more models did not validate:
cms.pagemoderatorstate: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
cms.globalpagepermission: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
cms.pagepermission: 'user' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
cms.pageuser: 'user_ptr' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
cms.pageuser: 'created_by' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
cms.pageusergroup: 'created_by' defines a relation with the model 'auth.User', which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.
如何让 Django-CMS 使用新的用户模型?
谢谢!