Skip to content
Alexandru Marcu edited this page May 30, 2015 · 4 revisions

Django Models:

  • Foreign keys appear at the top of models
  • single quote ' is preferred to double " which should only be used for block comments
  • Models of a single app should stay in one file
  • Models should not contain business logic (use services for this)
  • Explicitly declare the function or class you import (not xx.Foo, but from xx import Foo)
  • Always use absolute paths for imports
  • Class properties should only be declared in class constructor, unless static properties or constants

PEP-8 with the following exceptions:

  • Max line length is 100
Clone this wiki locally