# Django patterns

> Django patterns is an open-source agent skill for developer tools. Guides an agent through Django architecture, DRF APIs, ORM queries, caching and signals. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/smartworldarafath/REA_Skill/tree/main/.agents/skills/django-patterns
- **Repository:** https://github.com/smartworldarafath/rea_skill
- **GitHub stars:** 66
- **License:** MIT
- **Skill name:** django-patterns
- **Collection:** https://github.com/smartworldarafath/REA_Skill
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill gives an AI coding agent a reference of production Django conventions. It covers a recommended project layout with split settings for development, production and test, along with model and QuerySet design, custom managers, and a service layer that keeps business logic out of views.

For API work it shows Django REST Framework serializers with validation, ViewSets with filtering, search and ordering, and custom actions. It also covers performance: avoiding N+1 queries with select_related and prefetch_related, adding indexes, bulk operations, view, fragment and low-level caching, plus signals, custom middleware and production security settings such as HSTS and secure cookies.

The material is example code rather than executable scripts. The skill ships no scripts and sets no tool restrictions, so the agent applies these patterns by reading and editing the user's Django project. It assumes a working Django project using DRF, django-filter, WhiteNoise and corsheaders where those packages are referenced.

## When your agent uses it

> Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps. Use when building or reviewing Django apps, DRF APIs, ORM queries, or caching.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/django-patterns)
- [License: MIT](https://github.com/smartworldarafath/REA_Skill/tree/HEAD/.agents/skills/django-patterns)

## Features

- **Project layout:** Recommended folder structure with split settings for base, development, production and test.
- **Model and QuerySet design:** Custom user models, field constraints, indexes, and reusable QuerySet and manager methods.
- **DRF serializers and ViewSets:** Validation patterns, permissions, filtering, search, ordering and custom endpoint actions.
- **ORM performance:** Guidance on avoiding N+1 queries, choosing indexes and using bulk create, update and delete.
- **Caching strategies:** View-level, template fragment, low-level and QuerySet caching examples with timeouts.
- **Signals and middleware:** Examples of post-save signal handlers, app ready hooks and custom request logging middleware.
- **Production security settings:** Secure cookie, SSL redirect, HSTS and logging configuration for deployed Django sites.

## Good for

- Design a Django project structure with separate dev and production settings
- Review a Django REST API for N+1 queries and missing indexes
- Add filtering, search and ordering to a DRF ViewSet
- Cache an expensive Django view or queryset with a sensible timeout
- Create a service layer for order creation inside a transaction
- Set up a custom user model with email as the login field

## Install

### Claude Code

This skill ships in the `rea-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add smartworldarafath/REA_Skill
/plugin install rea-skills@smartworldarafath
```

Or copy only this skill to `~/.claude/skills/django-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/django-patterns &&
cp -R "$tmp/.agents/skills/django-patterns" ~/.claude/skills/django-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/django-patterns` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/django-patterns` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/django-patterns &&
cp -R "$tmp/.agents/skills/django-patterns" ~/.agents/skills/django-patterns &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/django-patterns` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/django-patterns` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/django-patterns &&
cp -R "$tmp/.agents/skills/django-patterns" ~/.cursor/skills/django-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/django-patterns` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/smartworldarafath/REA_Skill.git --path .agents/skills/django-patterns
```

Or copy the folder to `~/.gemini/skills/django-patterns` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/django-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/django-patterns &&
cp -R "$tmp/.agents/skills/django-patterns" ~/.copilot/skills/django-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/django-patterns` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/smartworldarafath/REA_Skill.git
```

Then copy `REA_Skill/.agents/skills/django-patterns` into your agent's skills folder as `django-patterns`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It has no scripts and no tool restrictions. It is a set of instructions and code examples the agent applies to a Django project, and it assumes Django with DRF and related packages are in use.

### Does Django patterns change my project automatically?

No script is bundled. The agent uses the patterns as guidance when it writes or reviews Django code.

### When does the skill activate?

It activates when a task involves building or reviewing Django apps, DRF APIs, ORM queries or caching, as described in its SKILL.md description.

### How do I install Django patterns in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/django-patterns to use it in all your projects, or to .claude/skills/django-patterns in one project. Or install the rea-skills plugin, which includes it: /plugin marketplace add smartworldarafath/REA_Skill, then /plugin install rea-skills@smartworldarafath.

### Does Django patterns run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Django patterns?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Django patterns?

The closest alternatives to Django patterns are Django TDD, Django security, Django celery, Django perf review and Backend patterns.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Django TDD](https://ai-powered.com/skills/django-tdd): Django TDD is an open-source agent skill for developer tools.
- [Django security](https://ai-powered.com/skills/django-security): Django security is an open-source agent skill for security.
- [Django celery](https://ai-powered.com/skills/django-celery): Django celery is an open-source agent skill for developer tools.
- [Django perf review](https://ai-powered.com/skills/django-perf-review): Django perf review is an open-source agent skill for databases.
- [Backend patterns](https://ai-powered.com/skills/backend-patterns): Backend patterns is an open-source agent skill for developer tools.
- [Django verification](https://ai-powered.com/skills/django-verification): Django verification is an open-source agent skill for developer tools.
- [Dataverse python advanced patterns](https://ai-powered.com/skills/dataverse-python-advanced-patterns): Dataverse python advanced patterns is an open-source agent skill for developer tools.
- [API design](https://ai-powered.com/skills/api-design): API design is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/django-patterns
