home / skills / partme-ai / full-stack-skills / django

django skill

/skills/django

This skill provides comprehensive Django guidance for models, views, templates, forms, admin, REST framework, and deployment to help you build robust Django

npx playbooks add skill partme-ai/full-stack-skills --skill django

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
672 B
---
name: django
description: Provides comprehensive guidance for Django framework including models, views, templates, forms, admin, REST framework, and deployment. Use when the user asks about Django, needs to create Django applications, implement models and views, or build Django REST APIs.
license: Complete terms in LICENSE.txt
---

## When to use this skill

Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]

## How to use this skill

[待完善:根据具体工具添加使用指南]

## Best Practices

[待完善:根据具体工具添加最佳实践]

## Keywords

[待完善:根据具体工具添加关键词]

Overview

This skill provides comprehensive, practical guidance for building web applications with the Django framework. It covers models, views, templates, forms, admin customization, Django REST Framework, testing, and deployment patterns. Use it to speed development, follow best practices, and troubleshoot common Django issues.

How this skill works

The skill inspects your requirements and suggests concrete Django patterns: data model design, view and URL structure, template organization, form handling, and admin setup. For APIs it outlines serializers, viewsets, routers, authentication, and pagination using Django REST Framework. It also offers deployment guidance for WSGI/ASGI hosts, static/media handling, and environment configuration.

When to use it

  • Starting a new Django project or app and deciding project structure
  • Designing or refactoring models and database relationships
  • Implementing views, class-based views, or API endpoints with Django REST Framework
  • Customizing the Django admin or adding admin actions
  • Preparing for deployment, configuring static files, and setting environment variables

Best practices

  • Design normalized models, use migrations for schema changes, and add indexes for query-heavy fields
  • Prefer class-based views and view mixins for reusable behavior; keep business logic in models or services
  • Validate user input with ModelForms or serializers; avoid trusting client data
  • Write tests for models, views, and APIs; use factories/fixtures and CI for regressions
  • Use environment variables for secrets, configure ALLOWED_HOSTS, DEBUG=False, and serve static/media via CDN or object storage

Example use cases

  • Create a blog app with Post and Comment models, list/detail views, and admin management
  • Build a JSON API with Django REST Framework: serializers, ModelViewSet, token or JWT auth, and paginated endpoints
  • Migrate a monolithic site to a modular app layout and add unit tests and CI pipelines
  • Customize the admin to support bulk actions, filters, and inline related models
  • Deploy a Django project to a PaaS or Docker container with Gunicorn/uvicorn, Nginx, and managed database

FAQ

Does this skill cover Django REST Framework?

Yes. It includes serializers, viewsets, routers, authentication, pagination, and common API patterns.

Will it help with deployment?

Yes. It provides practical deployment steps for WSGI/ASGI, static/media handling, environment configuration, and recommended production settings.