Skip to main content

Your Django models.
A REST API. No boilerplate.

Django Headless turns Django into a headless CMS backend. Decorate a model with @expose() and a predictable, read-friendly REST API appears — ready for your Next.js, Astro or any JAMstack frontend.

from django.db import models
from headless import expose

@expose()
class BlogPost(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
published = models.BooleanField(default=False)
GET/api/blog.blogpostlist + filters
POST/api/blog.blogpostcreate
GET/api/blog.blogpost/1detail
PUT/api/blog.blogpost/1update
DELETE/api/blog.blogpost/1delete

Everything included, nothing required

One decorator, full API

Add @expose() to any model and get list, detail and CRUD endpoints — no serializers, viewsets or URL wiring to write.

Plays nice with Django

Works alongside your existing apps, admin and DRF configuration. You decide what gets exposed.

Singletons

Site settings and configuration objects become a single GET/PUT resource, created on first write.

ORM filtering

Every Django lookup per field, straight from the query string: ?title__icontains=django, exclusions with ~.

Expandable relations

Optional flex-fields serialization expands related exposed models inline with ?expand=.

Secure by configuration

Built-in secret key authentication, permission overrides for generated routes, and read-only models.