Search code examples
jsondjangoapipython-3.8django-2.2

How to save json in django database?


I need to save json file from API in database (postgresql) using django. I have classic model which extends the AbstractUser with the default fields for first name, last name and etc. I made a research but can't find how to achieve saved json from API in database while using django. I will appreciate any help or guide.


Solution

  • I think JSONField is the best choice for you. In the meantime, do you really want to store API response? Maybe you should just extract some information from it?