djangoplay-web / Misc / Coding and Architecture Rules
DocsDjangoPlay WebMiscCoding and Architecture Rules

Coding and Architecture Rules

Views should orchestrate, not implement domain workflows.

1 min readApplies to v1.2.2
On this page ▾
  1. Keep Views Thin
  2. Services Own Business Logic
  3. Avoid Direct State Mutation
  4. Prefer Explicit Configuration
  5. Keep Calculators Pure
  6. Protect Cross-Domain Boundaries
  7. Security
  8. Resource Awareness

Keep Views Thin

Services Own Business Logic

Shared business rules belong in services.

Avoid Direct State Mutation

Use explicit workflows for lifecycle transitions.

Prefer Explicit Configuration

Do not silently infer production settings.

Keep Calculators Pure

Financial calculations should be deterministic and side-effect free.

Protect Cross-Domain Boundaries

Use stable interfaces rather than reaching into another domain's private implementation.

Security

Never commit:

text
passwords
API keys
JWT secrets
encryption keys
private certificates
database credentials

Resource Awareness

The production VM is intentionally small. Avoid unnecessary background workers, duplicate processes and memory-heavy infrastructure.