Yes, you can, but don't forget to name kwarg in function same as lookup 
field

@detail_route(lookup_field='shared_key',lookup_regex='[0-9a-f]{32}')
def get_weather_by_key(self, request, shared_key=None):
    return Response(Weather.objects.get(shared_key=shared_key)

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to