Я хочу создать URL, например:
/ api / foodfeeds /? Keywords = BURGER, teste & mood = happy & location = 2323,7767.323 & price = 2
urls.py
urlpatterns = [
path('admin/', admin.site.urls),
url(r'^api/foodfeed/(?P<keywords>[0-9.a-z, ]+)/(?P<mood>[0-9.a-z, ]+)/(?P<location>[0-9]+)/(?P<price>[0-9]+)/$', backend_views.FoodfeedList.as_view()),
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
views.py
class FoodfeedList(APIView):
# permission_classes = (permissions.IsAuthenticated,)
def get(self,request,keywords,mood,location,price):
print(request.GET['keywords'])