标签: python django django-rest-framework
我想用django-rest-framework 做一个搜索功能 这就是我所做的: 的 views.py: 我补充一点:
queryset = Site.objects.all() serializer_class = SiteSerializer filter_backends = (filters.SearchFilter,) search_fields = ('name',)
但是,当我访问htttp:127.0.0.1/api/v3/vgroup/?search=bob时,它会给我这个错误:
htttp:127.0.0.1/api/v3/vgroup/?search=bob