django-patterns
Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.
npx skills add mturac/everything-openai-codex --skill django-patterns --agent codex
Same command for any agent — swap --agent for claude-code, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Instructs the agent to adopt production-grade Django architecture patterns, covering project structure, split settings, model design, queryset patterns, custom managers, DRF serializers and viewsets, custom actions, a service layer, caching strategies, and related deployment considerations.
How it works
- Defines a split Django project layout with config/, apps/, and management files, plus separate settings for base, development, and production.
- Provides concrete model examples (User, Product) with best practices for fields, constraints, indexing, and slug handling.
- Introduces a custom QuerySet (ProductQuerySet) and a custom manager (ProductManager) with methods for common queries and bulk operations.
- Shows DRF patterns: serializers (with computed fields, validation, and create logic), viewsets (with select_related/prefetch, permissions, filtering, searching, ordering), and custom actions (featured, purchase, my_products).
- Includes custom API view (add_to_cart) illustrating a function-based view with authentication and error handling.
- Outlines a service layer (OrderService) handling create_order, process_payment, and sending confirmation emails, with transaction management.
- Demonstrates caching strategies: view-level caching via cache_page, template fragment caching, and low-level caching usage.
When to use it
- When building Django web applications and REST APIs with DRF
- When designing ORM models and complex queries
- When configuring production-ready settings and deployment structure
- When implementing caching, signals, and middleware in Django projects
What it can touch
- Code snippets show: Python modules under config/settings/, apps/users/, apps/products/, and services under apps/orders/
- Tools referenced: codex, copilot, cursor
Caveats
- Licensing: MIT
- The guidance is example-driven and requires adaptation to specific project contexts; no guarantees of behavior or performance are stated in the material.
# Django Development Patterns Production-grade Django architecture patterns for scalable, maintainable applications. ## When to Activate - Building Django web applications - Designing Django REST Framework APIs - Working with Django ORM and models - Setting up Django project structure - Implementing caching, signals, middleware ## Project Structure ### Recommended Layout ``` myproject/ ├── config/ │ ├── __init__.py │ ├── settings/ │ │ ├── __init__.py │ │ ├── base.py # Base settings │ │ ├── development.py # Dev settings │ │ ├── production.py # Production settings │ │ └── test.py # Test settings │ ├── urls.py │ ├── wsgi.py │ └── asgi.py ├── manage.py └── apps/ ├── __init__.py ├── users/ │ ├── __init__.py │ ├── models.py │ ├── views.py │ ├── serializers.py │ ├── urls.py │ ├── permissions.py │ ├── filters.py │ ├── services.py │ └── tests/ └── products/ └── ... ``` ### Split Settings Pattern ```python # config/settings/base.py from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent.parent SECRET_KEY = env('DJANGO_SECRET_KEY') DEBUG = False ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contri
- When to Activate
- Project Structure
- Recommended Layout
- Split Settings Pattern
- Model Design Patterns
- Model Best Practices
- QuerySet Best Practices
- Manager Methods
- Django REST Framework Patterns
- Serializer Patterns
- ViewSet Patterns
- Custom Actions
- Service Layer Pattern
- Caching Strategies
What does the django-patterns skill do?
Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.
How do I install it?
Run `npx skills add mturac/everything-openai-codex --skill django-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
