Post

JSON serialization of nan values in Django REST Framework

nan values cannot be directly serialized to JSON. Django REST Framework uses json.dumps(), which throws an error unless allow_nan=False is passed to it.

Ref.: https://chatgpt.com/share/6907c3ca-4a7c-8009-89a7-86e4a4c6b4c4

This post is licensed under CC BY 4.0 by the author.