class GetRouteDriver(APIView):
authentication_classes = (TokenAuthentication,)
permission_classes = (IsAuthenticated,)
def get(self, request, username, origin, destination):
origin_lat, origin_lng = origin.split(',')
destination_lat, destination_lng = destination.split(',')
url = 'https://maps.googleapis.com/maps/api/directions/json?origin=' + origin + '&destination=' + destination + '&key'+ GOOGLE_KEY
request_data = urllib2.urlopen(url)
serialized_data = request_data.read()
id = '1'
ride = json.loads(serialized_data)
return Response( ride, status=status.HTTP_200_OK )
i want to add the ID to the ride retrived from Google Maps API
and with the code from above i Got this and this is what i want.

if i Concatenate The ID i get this

this is the code with the concatenation
class GetRouteDriver(APIView):
authentication_classes = (TokenAuthentication,)
permission_classes = (IsAuthenticated,)
def get(self, request, username, origin, destination):
origin_lat, origin_lng = origin.split(',')
destination_lat, destination_lng = destination.split(',')
url = 'https://maps.googleapis.com/maps/api/directions/json?origin=' + origin + '&destination=' + destination + '&key'+ GOOGLE_KEY
request_data = urllib2.urlopen(url)
#serialized_data = request_data.read()
serialized_data = json.dumps({'ride_id': 1, 'route': request_data.read()})
ride = json.loads(serialized_data)
return Response( ride, status=status.HTTP_200_OK )
