DJ

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.zip

Installs 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.
64 charsno explicit “when” trigger
Intermediate

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

You give it
A request to implement architectural patterns in Django or Flask
You get back
Code adhering to specified Django or Flask architectural conventions

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) and prefetch_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.

SkillInstallsUpdatedSafetyDifficulty
django-flask-patterns (this skill)06moNo flagsIntermediate
django-pro204moNo flagsIntermediate
python04moNo flagsIntermediate
python-configuration52moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry