OpenParable
Skip to content
← Back to skills

Django Create API Endpoint

Development
django-create-api-endpoint

Django Create API Endpoint is an Agent Skill for development published in the fossasia/eventyay repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Steps for adding a new Django REST Framework API endpoint

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/fossasia/eventyay/blob/HEAD/.agents/skills/django-create-api-endpoint/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/django-create-api-endpoint, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

When to use

Use this skill when exposing new data or functionality via the DRF API using viewsets and serializers.

Steps

  1. Create or update a serializer in the appropriate location within app/eventyay/api/. Prefer using explicit serializer fields covering direct model or nested relation mappings.
  2. Create or update a viewset within app/eventyay/api/.
  3. Register the new viewset's router in the appropriate module router or app/eventyay/api/urls.py.

Validation

  1. Verify that the serializer correctly maps exactly to the expected model or relations without unnecessary custom method wrappers.
  2. Assert the endpoint resolves effectively.

Gotchas

  • Computed Data Overuse: Only use SerializerMethodField for genuinely computed or conditional data. Do NOT use it if a direct field assignment natively exists.