This skill should be used when the user asks to build a Django project, design Django models or database schemas, create views and APIs, configure deployment or settings, set up authentication and permissions, customize the Django admin, optimize query performance, configure background tasks with Celery or django-rq, build CMS or content management features, integrate external APIs, create Django forms or templates, integrate HTMX or Unpoly, review Django migrations, or scaffold a new Django app. It covers the full Django backend lifecycle from project structure through production deployment. It does NOT cover pure frontend work (use frontend-design for that) unless Django templates are involved.
This skill covers high-level Django project architecture: design thinking, project layout, settings organization, app boundaries, and core principles. For specific implementation domains, see the companion skills below.
| Skill | Covers |
|-------|--------|
| django-backend | Models, ORM, admin, auth, Celery, CMS |
| django-api | DRF, serializers, viewsets, filtering, integrations |
| django-frontend | Templates, Cotton, HTMX, Alpine.js, Tailwind, forms, design system |
| django-ops | Testing, deployment, performance, security, migrations |
| django-d3 | D3.js, Observable Plot, data visualization, chart modules |
Before writing any code, understand the shape of the application:
@csrf_exempt, allow_all_origins, or hardcoded secret requires explicit justification.primary, error, surface) instead of raw values (#1e40af). This enables theme switching and keeps the design consistent.For new projects, use this structure. It scales from a single-app tool to a multi-app platform without reorganization.
project_name/
manage.py
project_name/
__init__.py
settings/
__init__.py # imports from base, detects environment
base.py # shared settings
development.py # local overrides
production.py # production overrides
test.py # test-specific (fast passwords, in-memory cache)
urls.py # root URL conf, includes app URLs
wsgi.py
asgi.py
apps/
core/ # shared utilities, base models, middleware
models.py # abstract base models (TimeStampedModel, etc.)
middleware.py
templatetags/
core_tags.py
utils.py
your_app/
models.py
views.py
urls.py
admin.py
forms.py # if using Django forms/templates
serializers.py # if using DRF
services.py # complex business logic that spans models
tests/
__init__.py
test_models.py
test_views.py
templates/
base.html # site-wide base template
base_studio.html # section base (optional)
includes/ # shared partials (nav, footer, pagination)
cotton/ # django-cotton components
card.html
button/
filled.html
outlined.html
your_app/
list.html # full page templates
_list_partial.html # HTMX partials (prefixed with underscore)
detail.html
static/
css/
tokens.css # design system tokens (colors, typography, spacing)
main.css # base styles
js/
main.js # Alpine.js init, shared behavior
alpine-components.js # reusable Alpine.data() functions
charts/ # D3 chart modules
utils.js # shared chart setup
requirements/
base.txt
development.txt
production.txt
Key decisions in this structure:
Settings as a package rather than a single file. This eliminates if DEBUG blocks and environment-sniffing. Each environment file imports from base.py and overrides what it needs.
Apps inside an apps/ directory to keep the project root clean. A core app holds shared abstractions so other apps don't depend on each other.
A services.py file for logic that coordinates across multiple models or involves external API calls. This prevents views from becoming business logic dumps.
Templates organized by app, not by type. Components go in templates/cotton/. HTMX partials are prefixed with underscore (_list_partial.html). This keeps related templates together.
Static assets organized by purpose. Design tokens in tokens.css, Alpine components in their own file, D3 charts in a charts/ directory. Each has a clear responsibility.
settings to check environment. Use feature flags, middleware, or context processors.services.py.| Agent | Focus |
|-------|-------|
| django-architect | Full architecture review, cross-pillar design decisions |
| django-developer | General Django development, project scaffolding |
| fullstack-developer | Features spanning database through frontend |
| backend-developer | Server-side architecture and API design |
| python-pro | Advanced Python patterns and type safety |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer