drf-patterns
Skill2 starsChanged 8 days agoMITView on GitHub
Django REST Framework patterns, serializers, viewsets, permissions, throttling, filtering, pagination, and review checklist. Use whenever the project contains `djangorestframework` in dependencies, `rest_framework` in INSTALLED_APPS, files following DRF naming patterns (`serializers.py`, `viewsets.py`, `permissions.py`), OR the user asks about DRF, Django REST, serializers, viewsets, ModelViewSet, permission_classes, throttle_classes, even if DRF is not mentioned by name.
In this repository37 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- templates/CLAUDE.mdCLAUDE.md
- auditSkill
- backup-patternsSkill
- bash-patternsSkill
- depsSkill
- django-patternsSkill
- docker-patternsSkill
- engineering-fundamentalsSkill
- fastapi-patternsSkill
- git-patternsSkill
- go-patternsSkill
- graphql-patternsSkill
- investigateSkill
- javascript-patternsSkill
- logging-patternsSkill
- referenceSkill
- metaSkill
- monitoring-patternsSkill
- next-app-router-patternsSkill
- nuxt-patternsSkill
- opentofu-patternsSkill
- prSkill
- python-patternsSkill
- react-patternsSkill
- report-formatSkill
- security-patternsSkill
- slop-patternsSkill
- storybook-patternsSkill
- tailwind-patternsSkill
- test-patternsSkill
- typescript-patternsSkill
- unslopSkill
- vps-provisioningSkill
- vue-patternsSkill
- wcag-auditSkill
- writeSkill
The file
Files
Django REST Framework patterns
DRF 3.18.x. Supports Django 5.2, 6.0, and 6.1; 3.18.0 dropped Django 4.2, 5.0, and 5.1. Verify current version at https://pypi.org/project/djangorestframework/. Adapt advice to the version in the project's requirements.txt, pyproject.toml, or lockfile.
Reference files
| File | Covers |
| serializers.md | Explicit fields, validate(), nested serializers, SerializerMethodField, ModelSerializer |
| viewsets-and-routers.md | ModelViewSet vs GenericViewSet + mixins, @action, DefaultRouter |
| permissions.md | permission_classes, IsAuthenticated vs IsAuthenticatedOrReadOnly, object-level permissions |
| throttling-and-pagination.md | UserRateThrottle, AnonRateThrottle, pagination styles, page size config |
| filtering.md | django-filter, SearchFilter, OrderingFilter, get_queryset override |
| auth.md | TokenAuthentication, SessionAuthentication, JWT via simplejwt |
| versioning.md | Versioning schemes, request.version, ALLOWED_VERSIONS |
| anti-patterns.md | Severity-labeled anti-patterns to flag in review |
References
- https://www.django-rest-framework.org/
- https://www.django-rest-framework.org/api-guide/serializers/
- https://www.django-rest-framework.org/api-guide/permissions/
- https://django-rest-framework-simplejwt.readthedocs.io/en/latest/
Version notes
Checked: 2026-09-26 against https://pypi.org/project/djangorestframework/ and https://www.django-rest-framework.org/community/release-notes/
- 3.18.1 (2026-09-07): 3.18.0 dropped Django 4.2, 5.0, 5.1. A project pinned to one of those stays on 3.17.
- 3.14:
NullBooleanFieldremoved; useBooleanField(allow_null=True). - 3.5:
ModelSerializerwithoutfieldsorexcludebecame an error (deprecated since 3.3).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

