Django multi-stakeholder data validation architecture guidelines

I know this is a broad question. But imagine that you have a Django project with an API used by mobile application clients.

There are many places where you can add validation logic:

  • Fields of models themselves
  • Models overriding a method save()
  • Shapes and Shapes of Django Forms.
  • API serializers (generic serializers or model serializers)

When designing your project, what rules / elements will help you choose whether to indicate validation here or there?

+4
source share
1 answer

. , , . , , , API.

, ( ..) - , , . , . , API, , .

django , , . ModelForms. , : - , , , .

: "" " " " django".

DRY:

, , ( ) : . - . , , . , API, , - .

+4

Source: https://habr.com/ru/post/1628292/


All Articles