Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get url param in get django rest

class DetailView(APIView):
 ...
    def get(self, request, machine_name):
        application = Application.objects.get(machine_name=machine_name)
        serializer = OsdSerializer(application, context={
           "date_from": request.query_params.get("from")
        })

        return Response({"Everything you need to analyzing "+application.name: serializer.data})
 ...
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #url #param #django #rest
ADD COMMENT
Topic
Name
7+4 =