django-flask-patterns
Standardized patterns for maintaining and building Django and Flask applications.
Install
mkdir -p .claude/skills/django-flask-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13921" && unzip -o skill.zip -d .claude/skills/django-flask-patterns && rm skill.zipInstalls to .claude/skills/django-flask-patterns
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Models/views/templates (Django), blueprints (Flask), migrations.Key capabilities
- →Organize Flask routes using Blueprints
- →Implement the Application Factory pattern in Flask
- →Initialize Flask extensions within the factory
- →Place business logic in Django Model methods or Managers
- →Optimize Django ORM queries with `select_related` and `prefetch_related`
- →Work with Django and Flask templates
How it works
The skill provides guidelines for structuring Django and Flask applications, including model design, view choices, ORM optimization, and Flask blueprint and application factory patterns.
Inputs & outputs
When to use django-flask-patterns
- →Writing database migrations
- →Organizing Flask blueprints
- →Optimizing Django ORM queries
- →Working with templates
About this skill
Django / Flask Patterns
When to use this skill
- Maintaining Django or Flask applications.
- Writing migrations.
- Working with templates (Jinja2/DTL).
1. Django
- Models: Fat models, thin views. Put business logic in Model methods or Managers.
- CBV vs FBV: Context dependent, but stick to one style per project. Function-Based Views often cleaner for simple logic.
- ORM: Use
select_related(FK) andprefetch_related(M2M) to avoid N+1 queries.
2. Flask
- Blueprints: Always use Blueprints to organize routes.
- Application Factory: Use the
create_app()pattern for better testing and config management. - Extensions: Initialize extensions (
db.init_app(app)) inside the factory.
Limitations
- →Django CBV vs FBV choice is context dependent
- →Flask extensions must be initialized inside the application factory
- →Django ORM optimization specifically targets N+1 queries
How it compares
This skill provides specific architectural patterns for Python web frameworks, offering guidance beyond basic framework usage.
Compared to similar skills
django-flask-patterns side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| django-flask-patterns (this skill) | 0 | 6mo | No flags | Intermediate |
| django-pro | 20 | 4mo | No flags | Intermediate |
| python | 0 | 4mo | No flags | Intermediate |
| python-configuration | 5 | 2mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by sraloff
View all by sraloff →You might also like
django-pro
sickn33
Master Django 5.x with async views, DRF, Celery, and Django Channels. Build scalable web applications with proper architecture, testing, and deployment. Use PROACTIVELY for Django development, ORM optimization, or complex Django patterns.
python
mrfelton
Python development guidelines and best practices. Use when working with Python code.
python-configuration
wshobson
Python configuration management via environment variables and typed settings. Use when externalizing config, setting up pydantic-settings, managing secrets, or implementing environment-specific behavior.
api-development
netalertx
Develop and extend NetAlertX REST API endpoints. Use this when asked to create endpoint, add API route, implement API, or modify API responses.
django-patterns
affaan-m
Django架构模式、使用DRF的REST API设计、ORM最佳实践、缓存、信号、中间件以及生产级Django应用程序。
demo-views
django-mvp
Guide for creating demo views in the django-mvp Demo App. Use when adding new demo pages to showcase components, layouts, or features — covers view creation, template structure, URL wiring, and sidebar menu registration. Emphasizes single configurable view classes with .as_view() attribute overrides