last update
May 23, 2026
license
MITv1.0.0
format
SKILL.md
- Install
// Downloads SKILL.md into ~/.claude/skills/django-rest-builder/
$ curl -fsSL --create-dirs -o ~/.claude/skills/django-rest-builder/SKILL.md https://claudeskil.com/skills/django-rest-builder/SKILL.md - Invoke
// Inside Claude Code, type the skill name as a slash command
> /django-rest-builder scaffold a typed REST endpoint - Or just ask
// Claude loads the skill by itself when a request matches its description
> scaffold a typed REST endpoint
- name:
- Django REST Builder
- slug:
- django-rest-builder
- version:
- v1.0.0
- license:
- MIT
- author:
- @chiragthummar16
- categories:
- tags:
- #django#drf#python#rest#postgres
- description:
Django + DRF: serializers, viewsets, permissions, throttling, async views — production REST APIs.
// What you can do with it
- Serializers — generates serializers.ModelSerializer subclasses with explicit fields, nested relations, readonlyfields, and SerializerMethodField stubs where appropriate.
- Viewsets & routers — produces ModelViewSet / ReadOnlyModelViewSet classes and registers them with DefaultRouter in urls.py.
- Auth — wires restframeworksimplejwt (TokenObtainPairView, TokenRefreshView) or DRF's TokenAuthentication, including DEFAULTAUTHENTICATIONCLASSES.
- Permissions & throttling — sets DEFAULTPERMISSIONCLASSES, custom BasePermission subclasses, and scoped ScopedRateThrottle / UserRateThrottle with rates in DEFAULTTHROTTLERATES.
- OpenAPI docs — configures drf-spectacular (SpectacularAPIView, Swagger UI, Redoc).
- Async views — scaffolds async def views compatible with ASGI for non-blocking endpoints.
README.md
Django REST Builder
Django REST Builder scaffolds production-grade REST APIs on top of Django and Django REST Framework. It generates the serializers, viewsets, routers, permission classes, auth wiring, throttling, and OpenAPI schema you'd otherwise hand-write for every new app — following DRF conventions rather than a bespoke abstraction. It's aimed at backend and full-stack developers who already know Django and want a correct, opinionated starting point instead of copy-pasting boilerplate across projects.
When to use it
- You're adding a new resource to an existing DRF project and want a
ModelSerializer+ModelViewSet+ router registration in one pass. - You're standing up a fresh API and need JWT or token auth, per-view throttling, and Swagger/Redoc docs configured coherently.
- You want consistent permission patterns (
IsAuthenticated, object-level checks, role gates) across many endpoints. - You need an async view for an I/O-bound endpoint and want it wired correctly under ASGI.
What it does
- Serializers — generates
serializers.ModelSerializersubclasses with explicitfields, nested relations,read_only_fields, andSerializerMethodFieldstubs where appropriate. - Viewsets & routers — produces
ModelViewSet/ReadOnlyModelViewSetclasses and registers them withDefaultRouterinurls.py. - Auth — wires
rest_framework_simplejwt(TokenObtainPairView,TokenRefreshView) or DRF'sTokenAuthentication, includingDEFAULT_AUTHENTICATION_CLASSES. - Permissions & throttling — sets
DEFAULT_PERMISSION_CLASSES, customBasePermissionsubclasses, and scopedScopedRateThrottle/UserRateThrottlewith rates inDEFAULT_THROTTLE_RATES. - OpenAPI docs — configures
drf-spectacular(SpectacularAPIView, Swagger UI, Redoc). - Async views — scaffolds
async defviews compatible with ASGI for non-blocking endpoints.
Usage
curl -fsSL --create-dirs -o ~/.claude/skills/django-rest-builder/SKILL.md https://claudeskil.com/skills/django-rest-builder/SKILL.md
# then, inside your Django project:
"Build a REST API for the Order model with JWT auth, owner-only
write permissions, and 100/day throttling, plus Swagger docs."
Produces a serializer, a ModelViewSet, router registration, an IsOwnerOrReadOnly permission, throttle config, and a /api/schema/ + /api/docs/ route.
Tips & gotchas
- SimpleJWT tokens are stateless — add
rest_framework_simplejwt.token_blacklisttoINSTALLED_APPSand run migrations if you need logout/revocation. - Async DRF views can't call the ORM synchronously; wrap queries in
sync_to_asyncor use async ORM methods (aget,acreate), and run under an ASGI server like Uvicorn/Daphne. ScopedRateThrottleneeds athrottle_scopeattribute on the view plus a matching key inDEFAULT_THROTTLE_RATES, or throttling silently no-ops.- Regenerate the schema after model changes; drf-spectacular reads annotations, so add
@extend_schemafor non-obvious request/response shapes.
FAQ
JWT or token auth — which does it scaffold? Either. Default is SimpleJWT (access/refresh pairs); ask for DRF TokenAuthentication if you want simple opaque tokens instead.
Does it touch my existing settings? It edits INSTALLED_APPS and the REST_FRAMEWORK dict additively and shows a diff before applying.
Postgres-specific? It targets Postgres for ArrayField/JSONField and indexes, but the generated DRF code runs on any Django-supported database.
$ cat reviews/