Using JSON in Django Templates
You do not need to convert the JSON structure to a Django model to use it in a Django template: JSON structures (Python dicts) work fine in a Django template
eg. if you pass {'titles': titles['data']}as context for your template, you can use it like:
{% for title in titles %}
ID is {{title.id}}, and name is {{title.name}}
{% endfor %}
Django, . , .
JSON.
class Title(models.Model)
id = models.CharField(max_length=36)
name = models.CharField(max_length=255)
UUIDField
class Title(models.Model)
id = models.UUIDField(primary_key=True)
name = models.CharField(max_length=255)
Django
titles = r.json()
for title in titles['data']:
Title.objects.create(id=title['id'], name=title['name'])
context = {'titles': Title.objects.all()}