Skip to content

Django Best Practices

Django-specific coding standards for Arctyk ITSM.


Models

  • Use descriptive model names (singular)
  • Add __str__ method to all models
  • Use related_name for reverse relationships

Views

  • Prefer class-based views for CRUD operations
  • Use function-based views for simple logic
  • Keep views thin, move logic to models/forms

Forms

  • Use Django forms for all user input
  • Implement custom validation in clean_* methods
  • Use widgets for custom rendering