Backend documentation¶
The Open Forms backend is developed using the Django framework (Python based).
Django has a concept of “apps” within a project which logically contain some functionality. The codebase layout reflects this - but the documentation is structured following the outlined Architecture.
General principles¶
On top of all this, we apply some general principles to keep/make the codebase maintainable.
Keep Django apps contained
Django apps should focus on a single responsibility with minimal dependencies on the “outside world”.
Explicitly expose public API
Usually we only consider the service.py
module of a Django app to be public API.
Please think twice before introducing breaking changes in those modules.
Refrain from importing private API
Importing things from modules in core functionality is generally frowned upon (
service.py
is the exception here). Modules should be able to freely alter their
implementation details, including their data model!
Document useful, generic functionality
Documentation makes it easier to find out what exists and avoid re-implementing the same thing twice.