Hi I'm having a very annoying issue with django: I've setup many urls paths and they all work fine except one and I really can't figure out why:
Urls
urlpatterns = [ # path('foods/search', food_search), path('food_list/', FoodListVersionListCreateAPIView.as_view(), name='foodList-list'), path('all_foods/<str:survey>/<str:string>', FoodListCreateAPIView.as_view(), name='food-list'), path('food_classification/', FoodClassificationListCreateAPIView.as_view(), name='foodClassification-list'), path('food/<str:survey>/<str:string>/', FoodDetailAPIView.as_view(), name='food-detail'), ] Views
class FoodListCreateAPIView(generics.ListCreateAPIView): queryset = Food.objects.all() serializer_class = FoodSerializer filter_backends = [DjangoFilterBackend, filters.SearchFilter] filterset_fields = ['description', 'food_code', 'cofid_code', 'foodex_code', 'food_classification'] search_fields = ['food_list', 'SYSTEM_TIME'] permission_classes = [permissions.IsAuthenticatedOrReadOnly] def get_queryset(self): assert self.queryset is not None, ( "'%s' should either include a `queryset` attribute, " "or override the `get_queryset()` method." % self.__class__.__name__ ) survey = self.request.query_params['survey'] food = self.request.query_params['string'] raw_queryset = perform_food_search(survey, food) queryset = Food.objects.filter(pk__in=[i.pk for i in raw_queryset]) if isinstance(queryset, QuerySet): # Ensure queryset is re-evaluated on each request. queryset = queryset.all() return queryset Error message
