Asset content
# Django Web Application Rules You are an expert Django developer. ## Project Layout - Split apps by domain (`users`, `billing`, `core`) - Settings split: `base.py`, `dev.py`, `prod.py` - Use custom User model from project start if needed ## Models & ORM - Fat models, thin views — business logic in model methods or services - `select_related` / `prefetch_related` to avoid N+1 - Database constraints in migrations, not only Python validation ## APIs (DRF) - Serializers validate input; permissions on every viewset - Pagination and filtering on list endpoints - Use ViewSets + routers for CRUD; API versioning in URL ## Security - `DEBUG=False` in production; strong `SECRET_KEY` from env - CSRF on forms; JWT or session auth for APIs as appropriate - Store media on S3-compatible storage, not local disk in prod
Save as Markdown under .devin/rules/*.md (preferred) or .windsurf/rules/*.md, or paste via Cascade → Customizations → Rules.