- Validation logic is separate from the main logic.
- Reusable logic for many views.
- Reusable input and output data formats.
- More clean views.
- Decorators. Feel free to use any side Django decorators like
- Parser. Parse request body.
- PreValidator. Validate and clear request.
- PreRenderer. Render and return PreValidation errors response.
- Controller. Main logic: do some things.
- PostValidator. Validate and clear response.
- PostRenderer. Render and return PostValidation errors response.
- Renderer. Render successful response.
Required only controller and renderer.
- Mixins chaos and wrong usage. Mixins is good but dangerous conception. Use it carefully.
- You can decorate Django view in so many places: urls, view, dispatch method, get/post method, form_valid method etc. DjBurger has special place for all decorators.
- Validation and main logic mixing. In bad code you can validate and apply some data in one loop, and if you found and return validation error then operation will be applied partially. Example:
for user in users: if user.is_anonymous(): raise ValueError("Can't send SMS to anonymous user!") send_sms(user)
This is bad code! We will send some SMS before error raising. DjBurger force input validation only before main logic.
- Big and implicit views. This code is unsupported and non-expandable. DjBurger split view by steps.
- Logic duplication in views require more time to made changes and and increase probability of mistake. With DjBurger you can use one controller into many views.