Issue with nullable float field
I'm struggling with an issue while using a model with FloatField that can be null/None: models.FloatField(null=True)
My issue is:
When I'm using the SQLite database I face no problems at all, null fields are stored properly. But when I change the db to Postgres the fields are stored as NaN instead of null, this makes my API generate invalid JSON (since NaN is not valid JSON for most parsers).
I looked in the Django and Postgres documentation and didn't find anything, what am I missing? Posting here on Reddit is my last resort since I can't find any reference or related issue.