orsinium-archive / djburger

Framework for safe and maintainable web-projects.
https://djburger.readthedocs.io
GNU Lesser General Public License v3.0
75 stars 6 forks source link
api cbv clean-code contracts-programming decorators design-by-contract django django-rest-framework marshmallow mvc mvc-framework parse python rest rest-api restful-api scheme solid validation validator

DjBurger

DjBurger logo

Build Status Documentation PyPI version Status Code size License

DjBurger -- framework for safe and maintainable web-projects.

What DjBurger do?

DjBurger doesn't depend on Django. You can use it in any projects if you want.

Read more into documentation.

Key principles

  1. Validation logic is separate from the main logic.
  2. Reusable logic for many views.
  3. Reusable input and output data formats.
  4. More clean views.

Dataflow

  1. Decorators. Feel free to use any side Django decorators like csrf_exempt.
  2. Parser. Parse request body.
  3. PreValidator. Validate and clear request.
  4. PreRenderer. Render and return PreValidation errors response.
  5. Controller. Main logic: do some things.
  6. PostValidator. Validate and clear response.
  7. PostRenderer. Render and return PostValidation errors response.
  8. Renderer. Render successful response.

Scheme

Required only Controller and Renderer.

Explore

  1. Read documentation.
  2. See example project.
  3. For quick help just inspect djburger from python console (for example, help('djburger.views')).
  4. If you have some questions then view issues or create new.
  5. If you found some mistakes then fix it and create Pull Request. Contributors are welcome.
  6. Star this project on github :)