[Django]-How to replace or edit the lookup parameter in a django rest framework Router?

8👍

✅

simply update your code to something like this:

class ProductViewSet(ModelViewSet):
    lookup_field = 'my_uuid_field'

lookup_field tells DRF to use this field instead of pk to get items

Leave a comment