【问题标题】:Django-ratings CommandError for models模型的 Django-ratings CommandError
【发布时间】:2014-04-28 16:45:34
【问题描述】:

我安装了一个应用程序 django-ratings。我想同步数据库,但这是我的错误:

djangoratings.vote: 'user' defines a relation with the model 'auth.User',
which has been swapped out. Update the relation to point at settings.AUTH_USER_MODEL.

我正在使用 AllAuth 进行 Facebook 登录,以及具有一些额外功能的自定义用户身份验证。

在我提供的设置文件中

AUTH_USER_MODEL = 'accountext.User'

如何从 djangoatings 修复该错误?

感谢

【问题讨论】:

  • 确保accountextINSTALLED_APPS
  • accountext 在 INSTALLED_APPS 中:/

标签: python django django-ratings


【解决方案1】:

这是一个公开的django-ratings 问题:Complete Django 1.5 Custom User Model compatibilitydjango-ratings 是在自定义用户模型实施之前创建的。它uses auth.User model directly 而不是通过动态AUTH_USER_MODEL 设置。

django-ratings 没有得到积极维护,拉取请求多年来一直处于打开状态。我会考虑不使用它。

【讨论】:

  • 谢谢。我一直在寻找那种类型的答案,但没有运气。你知道其他的选择吗? Django-simple-ratings 也不起作用。
  • @juree 还有django-generic-ratings 但看起来它也有同样的问题。嗯,Django-simple-ratings 开发得比较积极,考虑filing an issue
猜你喜欢
  • 2015-02-08
  • 2014-03-11
  • 2017-06-27
  • 1970-01-01
  • 2013-04-06
  • 1970-01-01
  • 2016-10-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多