Save request response(json) in django model field

Hello !
I would like to save the responses from API calls in a django mode field. I want to use the response content later to generate files and for audit concern too. I’m thinking about the JSONField, is this the best idea? Thanks in advance

Welcome @batajoie !

There is no “best” idea here. It’s all highly dependent upon what the responses and the later processing is. It’s frequently (but not always) a “you can pay me now or pay me later” situation.

Dumping the response into a JSON field might be the easiest answer up front, but if you’re needing to process the data later, you’re just shifting the work. It could be a case that by expending the effort up front to organize and store those responses in an appropriate data model, it makes your later “file creation and audit” processes much easier.

But again, there’s no one answer here. Just choices to be made depending upon your particular requirements.

1 Like