1👍
✅
path = "{0}/app_name/fixtures/book.json".format(settings.PROJECT_ROOT)
with open(path, "w") as out:
json_serializer.serialize(Book.objects.all(), stream=out)
Source:stackexchange.com