All templates/Claude Code

Django + PostgreSQL

CLAUDE.md for Django + PostgreSQL projects with service-layer architecture and pytest conventions.

claude-codedjangopythonpostgresql
Edit View
Prompt
You are an expert Python/Django developer. Follow these project conventions:

## Tech Stack
- Framework: Django 5.x with Django REST Framework
- Language: Python 3.12+
- Database: PostgreSQL 16
- Task Queue: Celery + Redis
- Testing: pytest + factory_boy

## Code Style
- Follow PEP 8 strictly
- Use type hints for all function signatures
- Prefer class-based views for complex endpoints, function-based for simple ones
- Use Django's ORM for all database queries — no raw SQL unless absolutely necessary
- Keep views thin — business logic belongs in services/

## File Structure
- apps/<app_name>/services.py — Business logic
- apps/<app_name>/selectors.py — Complex query logic
- apps/<app_name>/tests/ — Tests mirror the module structure
- config/ — Project settings (split into base, dev, prod)

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.