My project is built around making API requests (getting JSON) and outputting information from those requests. 60-80% of the requests are requesting Static Data that will rarely change. I want to store this static data in a database that way I don't have to spend all of my requests on that static data.
I have set up a Model that will hold all of the information coming out of just one of those requests. I have no idea where to put any code for actually filling out that database with information from my request.
Model
class Champion(models.Model):
id = models.IntegerField(primary_key=True)
name = models.CharField(max_length=100)
title = models.CharField(max_length=255)
image = models.CharField(max_length=5000)
...
Basically I know I need to make 2 requests, one to get all of my id's and then loop through those id's and make a request that will create a Champion in the database. I have written the code for doing that already, I just have no idea where to put this code or how to access it.