roninforge/roninforge-django/django-api
Claude Code and agent skill by roninforge/roninforge-django
- community
Checking that the SKILL.md file is still in the repository.
Generate a complete DRF API endpoint from a description. Includes serializer, viewset, router registration, permissions, filtering, and pagination.
Install
npx vskill@latest install roninforge/roninforge-django/django-apiSKILL.md
The same SKILL.md was published earlier as roninforge/roninforge-django/django-api.
Generate Django REST Framework API
When to Use
Use this skill when:
- Creating a new API endpoint for an existing Django model
- Setting up DRF in a project for the first time
- The user asks for a REST API for a specific resource
Instructions
- Check if Django REST Framework is installed by looking for
rest_frameworkinINSTALLED_APPS. If not present, suggest adding it.
- Check for existing DRF configuration in
settings.py:
REST_FRAMEWORKdict (pagination, authentication, permissions)- If missing, suggest adding default configuration
- Identify the target model by reading the project's
models.py.
- Generate the API components:
Serializer:
- Use
ModelSerializerwith explicitfields - Set
read_only_fieldsfor auto-generated fields (id, timestamps) - If the API needs different read/write shapes, generate separate serializers
- For nested relationships, mark them
read_only=Trueunless write-through is explicitly needed
ViewSet or Generic View:
- Use
ModelViewSetfor full CRUD - Use
ReadOnlyModelViewSetfor read-only - Use specific generics (ListCreateAPIView, etc.) when not all CRUD is needed
- Always override
get_queryset()withselect_related/prefetch_related - Set
permission_classes - Add
filter_backendswithDjangoFilterBackend,SearchFilter,OrderingFilter - Set
filterset_fields,search_fields,ordering_fields - Use
perform_createfor request-dependent field assignment
URL Registration:
- Register viewsets with
DefaultRouter - Include router URLs under an
api/prefix - Set
basenamewhenget_querysetis overridden without aquerysetattribute
Permissions:
- Default to
IsAuthenticatedOrReadOnlyfor public resources - Create custom object-level permissions when ownership matters
- Suggest
LoginRequiredMiddleware(Django 5.1+) if not already configured
- If this is the project's first DRF endpoint, also generate the settings configuration:
``python REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication', ], 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticatedOrReadOnly', ], 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', 'PAGE_SIZE': 20, 'DEFAULT_FILTER_BACKENDS': [ 'django_filters.rest_framework.DjangoFilterBackend', 'rest_framework.filters.SearchFilter', 'rest_framework.filters.OrderingFilter', ], } ``
- Consult the API patterns reference for common endpoint structures.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/django-api/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/roninforge/roninforge-django/django-api)