Skip to content

Coding Standards

Python and Django

  • Follow PEP 8 with 4-space indentation.
  • Prefer clear function and variable names.
  • Keep domain behavior inside owning module boundaries.
  • Use shared core abstractions for cross-cutting behavior.

Imports and Boundaries

  • Standard library imports first, then third-party, then local modules.
  • Domain apps may depend on core.
  • Domain apps should avoid importing peer app internals.

Error Handling and Logging

  • Prefer specific exceptions over broad catches.
  • Use structured logs for operationally significant failures.
  • Return actionable user-facing messages in UI workflows.

Code Review Expectations

  • Tests accompany logic changes.
  • Migration implications are documented.
  • Security-sensitive changes are explicitly reviewed.

Small diff strategy

Keep changes focused by concern: logic, migrations, and docs should be easy to review independently.