JSON to Django Model

Generates a draft Django models.Model from a JSON sample. Field lengths, nullability, indexes, and relations are placeholders and always need review before makemigrations.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
JSON input
0 lines · 0 charsJSON
Django model output
Ctrl/Cmd+Shift+C
0 charsPython

Example

{"title": "Post", "views": 12, "published": true}

produces:

class Model(models.Model):
    title = models.CharField(max_length=255)  # TODO: confirm max_length
    views = models.IntegerField()
    published = models.BooleanField(default=False)

FAQ

Can I convert Django models back to JSON?
Yes! Click the ⇌ swap button or toggle the Direction dropdown to generate mock JSON from any Django models.Model definition.
Is this migration-ready?
No. It is a starting draft. Every CharField length, nullability flag, and relation is a placeholder for a human to confirm.
How are nested objects and arrays handled?
As models.JSONField() with a comment suggesting you consider a related model instead, since JSON generation cannot infer your intended relational structure.
What happens to a field observed as null?
It is flagged with null=True, blank=True and a comment to review nullability and the actual field type.