Django Web App taste — ChatGPT prompt for Django
The Django Web App taste prompt for ChatGPT sets Python and Django coding preferences. It covers project structure, APIs, tests, and deployment settings.
CC0-1.0 ★ 178,201 updated 2026-10-24
Open on GitHubWhat Django Web App taste does
The prompt sets conventions for Django projects: begin with a custom AbstractUser model, separate settings by environment, and keep business logic in service functions or model methods. It favors generic views for CRUD and Django REST Framework or django-ninja for APIs with explicit schemas.
Other guidelines cover database queries and constraints, background jobs, and tests with pytest-django and factory_boy. Multi-step writes use transaction.atomic; queued jobs should have explicit retries. A migration that has already run in production must not be edited.
For deployment, the prompt calls for DEBUG=False, a configured ALLOWED_HOSTS, and a passing python manage.py check --deploy in CI. It also names Ruff, mypy, and django-stubs, plus WhiteNoise or a CDN for static files and object storage for user uploads.
What it helps with
- set conventions for a new Django project
- keep business logic out of views and signals
- choose an API, testing, and background-job approach
- check Django deployment settings
Example prompts for the agent
- Set up a Django project with a custom user model and environment-specific settings.
- Design a Django REST Framework API with explicit serializers and tests.
- Review these Django deployment settings and suggest changes.
How to install Django Web App taste
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about Django Web App taste
How do I install Django Web App taste in Claude Code?
Add the prompt file at .claude/commands/prompts.csv.md. In ChatGPT, provide the prompt in a message.
What does Django Web App taste do?
It sets Django development conventions for project structure, database access, APIs, tests, and deployment.
Which testing tools does Django Web App taste recommend?
It names pytest-django and factory_boy for tests. Query counts can be checked with django-debug-toolbar or assertNumQueries.
Source text
prompts.csv · CC0-1.0
# Django Web App taste of a Python backend engineer - Start every project with a custom user model (AbstractUser) even if it adds no fields yet. Confidence: 0.95 - Split settings by environment and read secrets and URLs from environment variables with django-environ or similar. Confidence: 0.90 - Keep apps small and domain-focused; an app that imports half the project is a sign it should be split or merged. Confidence: 0.75 - Put business logic in plain service functions or model methods, not in views, serializers or signals. Confidence: 0.85 - Avoid signals for core workflows; call the side effect explicitly so the flow is readable and testable. Confidence: 0.85 - Use select_related and prefetch_related deliberately and check query counts with django-debug-toolbar or assertNumQueries. Confidence: 0.90 - Add database constraints (UniqueConstraint, CheckConstraint) instead of relying only on form or serializer validation. Confidence: 0.90 - Review every generated migration before committing and never edit a migration that has already run in production. Confidence: 0.90 - Write data migrations with RunPython using apps.get_model, never importing models directly. Confidence: 0.85 - Prefer class-based generic views for CRUD and function views for anything with unusual control flow. Confidence: 0.70 - Use Django REST Framework or django-ninja for APIs, with explicit serializers or schemas rather than fields = "__all__". Confidence: 0.85 - Wrap multi-step writes in transaction.atomic and enqueue background jobs with transaction.on_commit. Confidence: 0.90 - Run slow or external work in Celery or another task queue, with idempotent tasks and explicit retries. Confidence: 0.85 - Write tests with pytest-django and factory_boy instead of fixtures checked in as JSON. Confidence: 0.85 - Keep the admin for staff operations; customize list_display, search_fields and list_select_related so it stays fast. Confidence: 0.80 - Serve static files with WhiteNoise or a CDN and user uploads from object storage, never from the app server disk. Confidence: 0.85 - Run behind gunicorn or uvicorn with DEBUG=False, ALLOWED_HOSTS set and python manage.py check --deploy passing in CI. Confidence: 0.95 - Use HTMX with server-rendered templates before reaching for a separate SPA. Confidence: 0.65 - Pin dependencies with a lock file and upgrade Django LTS releases on a schedule. Confidence: 0.80 - Lint and format with Ruff and type check with mypy plus django-stubs. Confidence: 0.75
© f · CC0-1.0 · f/prompts.chat