Django Admin and Service Layer

Django Admin and Service Layer 图片 1

Services are a missing layer in the Django architecture. Django does not provide guidance on where to place complex logic for modifying multiple models, but many development teams have chosen to follow the clean architecture pattern and introduce a service layer. This layer acts as a middleman between interfaces such as views or API endpoints, and models.

However, in Django, many features are built around direct use of models. For example, Django admin assumes that models are directly modified and calls the save() method on changes.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论