Django Create API Endpoint
Developmentdjango-create-api-endpointDjango 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
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- 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
- 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. - Create or update a viewset within
app/eventyay/api/. - Register the new viewset's router in the appropriate module router or
app/eventyay/api/urls.py.
Validation
- Verify that the serializer correctly maps exactly to the expected model or relations without unnecessary custom method wrappers.
- Assert the endpoint resolves effectively.
Gotchas
- Computed Data Overuse: Only use
SerializerMethodFieldfor genuinely computed or conditional data. Do NOT use it if a direct field assignment natively exists.