【发布时间】:2020-12-11 05:27:45
【问题描述】:
我有一个版本为 2.2.13 和 django oauth 工具包 1.0.0 的 django 应用程序。为了更新到 Django 3.0,我需要更新 django-oauth-toolkit,但是在 1.0.0 之后的每个版本,我都会遇到迁移问题,因为我的应用程序 (oauth2) 扩展了抽象应用程序 (AbstractApplication) 模型oauth2_provider(来自 django-oauth-toolkit)。
from oauth2_provider.models import AbstractApplication
class Application(AbstractApplication):
# there are more fields added here
pass
这个自定义 oauth 应用程序 (oauth2) 有 28 个迁移,这些迁移是在项目本身内部生成的。
当我们尝试从头开始运行所有迁移时(我们在 CI 服务器上执行此操作),尝试为应用程序运行迁移 0001 时出现错误 oauth2_provider
ValueError: Related model 'oauth2.Application' cannot be resolved.
项目中有一个类似于我的问题,https://github.com/jazzband/django-oauth-toolkit/issues/778,但提供的解决方法不起作用,我还没有找到其他解决方案。
谢谢。
【问题讨论】:
标签: python django django-migrations django-oauth-toolkit