Django使用HyperlinkedModelSerializer錯誤
# django.core.exceptions.ImproperlyConfigured: Could not resolve URL for hyperlinked relationship using view name "cure-detail".
# You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field.
#
解決方法
- 第一步: 檢查對應View視圖的URL中是否 定義name值
- 第二步: 檢查 name 值是否正確(name值不能自定義,規則’model-detail’)
- 第三步: 可以排除錯誤–使用ModelSerializer