roninforge/roninforge-django/django-api

Claude Code and agent skill by roninforge/roninforge-django

Trust tier 3
  • community
Source check pending

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-api

SKILL.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

  1. Check if Django REST Framework is installed by looking for rest_framework in INSTALLED_APPS. If not present, suggest adding it.
  1. Check for existing DRF configuration in settings.py:
  • REST_FRAMEWORK dict (pagination, authentication, permissions)
  • If missing, suggest adding default configuration
  1. Identify the target model by reading the project's models.py.
  1. Generate the API components:

Serializer:

  • Use ModelSerializer with explicit fields
  • Set read_only_fields for auto-generated fields (id, timestamps)
  • If the API needs different read/write shapes, generate separate serializers
  • For nested relationships, mark them read_only=True unless write-through is explicitly needed

ViewSet or Generic View:

  • Use ModelViewSet for full CRUD
  • Use ReadOnlyModelViewSet for read-only
  • Use specific generics (ListCreateAPIView, etc.) when not all CRUD is needed
  • Always override get_queryset() with select_related/prefetch_related
  • Set permission_classes
  • Add filter_backends with DjangoFilterBackend, SearchFilter, OrderingFilter
  • Set filterset_fields, search_fields, ordering_fields
  • Use perform_create for request-dependent field assignment

URL Registration:

  • Register viewsets with DefaultRouter
  • Include router URLs under an api/ prefix
  • Set basename when get_queryset is overridden without a queryset attribute

Permissions:

  • Default to IsAuthenticatedOrReadOnly for public resources
  • Create custom object-level permissions when ownership matters
  • Suggest LoginRequiredMiddleware (Django 5.1+) if not already configured
  1. 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', ], } ``

  1. 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/roninforge/roninforge-django/django-api/badge)](https://verified-skill.com/skills/roninforge/roninforge-django/django-api)

Something wrong with this skill or its page? Tell us.