[Answered ]-Full URL in Django REST framework serializer

2👍

The reason is your serialization is done out of the scope of a request.
By default, they’ll be passed in the serializer context because they are required for HyperLinked data.

You should create a fake request with the RequestFactory and pass it to the serializer’s context:

artworks_serialized = ArtworkSerializer(
    artworks, many=True,
    context={'request': request})

Leave a comment