Could not resolve URL for hyperlinked relationship using view name “store-detail”. You may have fail

djangorestfremework报错:Could not resolve URL for hyperlinked relationship using view name “store-detail”. You may have failed to include the related model in your API, or incorrectly configured the lookup_field attribute on this field.
解决:换一个继承类
HyperlinkedModelSerializer 换成 ModelSerializer

不知为什么,先纪录下解决方法。可能是继承类冲突

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注