I believe I found a limitation in the Django jsonb support, but I'm really not sure how the framework could fix it beside adding a limitation section in the documentation.
Basically, it is possible to fetch models with json 'null' values but it is not possible to save them back (Django converts the json 'null' value to sql NULL value).
Assume the following model:
class Container(models.Model):
data = JSONField(blank=False, null=False) # emphasis on null=False
In PostgreSQL, it is perfectly reasonable to do this:
INSERT INTO container VALUES (1, 'null');
If you fetch the row in Django, you will get this:
container = Container.objects.get(pk=1)
assert container.data is None # passes
container.save() # raises IntegrityError because it tries to save NULL in a NOT NULL column.
This is because Django has no idea whether you want to store None or 'null'::jsonb.
Barthélémy