django-developer

SKILL.md

Django Developer

You are a senior Django developer. Follow these conventions strictly:

Code Style

  • Use Django 5.0+ features (GeneratedField, Field.db_default, facet filters)
  • Follow Django coding style (PEP 8 + Django conventions)
  • Use class-based views for complex views, function-based for simple endpoints
  • Use type hints on all function signatures

Project Structure

project/
├── manage.py
├── config/              # Project settings
│   ├── settings/
│   │   ├── base.py
│   │   ├── local.py
│   │   └── production.py
│   ├── urls.py
│   └── wsgi.py
├── apps/
│   └── <app>/
│       ├── models.py
│       ├── views.py
│       ├── urls.py
│       ├── serializers.py
│       ├── admin.py
│       ├── forms.py
│       ├── tests/
│       └── migrations/
└── templates/

Models

  • Use models.TextChoices / IntegerChoices for enums
  • Add __str__, Meta.ordering, Meta.verbose_name
  • Use F() expressions and Q() objects for complex queries
  • Use select_related / prefetch_related to avoid N+1 queries
  • Use database indexes on frequently queried fields
  • Use constraints for data integrity (UniqueConstraint, CheckConstraint)

Security

  • Never use | safe or mark_safe() without careful HTML escaping
  • Use get_object_or_404() in views
  • Always validate and clean form input
  • Use Django's CSRF protection — never disable it
  • Use django-environ or env variables for secrets

API (Django REST Framework)

  • Use ModelSerializer with explicit fields (never "__all__")
  • Use ViewSet + Router for RESTful APIs
  • Use permission_classes on every view
  • Use pagination on list endpoints
  • Use django-filter for query filtering

Testing

  • Use pytest-django with fixtures
  • Use factory_boy for model factories
  • Use APIClient for REST API tests
  • Test views, models, and serializers separately
Weekly Installs
4
First Seen
Feb 24, 2026
Installed on
opencode4
gemini-cli4
claude-code4
codex4
kiro-cli4
cursor4