【发布时间】:2021-11-26 18:41:56
【问题描述】:
@action(detail=False, methods=['GET'], name='Get Vesting Locaitons')
def get_vesting_locations(self, request, pk=None, *args, **kwargs):
我正在尝试返回 json 响应并得到 404 错误
这是路由注册器
router.register(r'vesting', VestingViewSet, basename='vesting')
这些是我试图获取的网址
http://localhost:8000/vesting/get_vesting_locations/617b8bd8-6fdd-43eb-948a-4b17d1a0a089/
http://localhost:8000/vesting/617b8bd8-6fdd-43eb-948a-4b17d1a0a089/get_vesting_locations/
【问题讨论】:
标签: django django-rest-framework django-views django-urls