Skip to content
This repository has been archived by the owner on Mar 30, 2020. It is now read-only.

Commit

Permalink
philosophy improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed May 12, 2018
1 parent 7285461 commit 67cf60e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

[![Build Status](https://travis-ci.org/orsinium/djburger.svg?branch=master)](https://travis-ci.org/orsinium/djburger) [![Documentation](https://readthedocs.org/projects/djburger/badge/)](https://djburger.readthedocs.io/en/latest/) [![PyPI version](https://img.shields.io/pypi/v/djburger.svg)](https://pypi.python.org/pypi/djburger) [![Status](https://img.shields.io/pypi/status/djburger.svg)](https://pypi.python.org/pypi/djburger) [![Code size](https://img.shields.io/github/languages/code-size/orsinium/djburger.svg)](https://github.com/orsinium/djburger) [![License](https://img.shields.io/pypi/l/djburger.svg)](LICENSE)

**DjBurger** -- framework for big Django projects.
**DjBurger** -- framework for safe and maintainable web-projects.

What DjBurger do?

* Split Django views into steps for secure and clean code.
* Split Django views into [steps](https://djburger.readthedocs.io/en/latest/philosophy.html#dataflow) for secure and clean code.
* Provide built-in objects for all steps.
* Integrates this many side libraries like Django REST Framework and Marshmallow.
* Integrates this [many side libraries](https://djburger.readthedocs.io/en/latest/external.html) like Django REST Framework and Marshmallow.

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

Expand All @@ -23,17 +23,16 @@ Read more into [documentation](https://djburger.readthedocs.io/en/latest/).
3. Reusable input and output data formats.
4. More clean views.


## Dataflow

1. **Decorators** (`d`). Feel free to use any side Django decorators like `csrf_exempt`.
2. **Parser** (`p`). Parse request body.
3. **PreValidator** (`prev`). Validate and clear request.
4. **PreRenderer** (`prer`). Render and return PreValidation errors.
5. **Controller** (`c`). Main logic: do some things.
6. **PostValidator** (`postv`). Validate and clear response.
7. **PostRenderer** (`postr`). Render and return PostValidation errors.
8. **Renderer** (`r`). Render successful response.
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](wiki/source/imgs/scheme.png)

Expand All @@ -47,3 +46,4 @@ Required only Controller and Renderer.
1. If you have some questions then [view issues](https://github.com/orsinium/djburger/issues) or [create new](https://github.com/orsinium/djburger/issues/new).
1. If you found some mistakes then fix it and [create Pull Request](https://github.com/orsinium/djburger/compare). Contributors are welcome.
1. [Star this project on github](https://github.com/orsinium/djburger) :)

4 changes: 2 additions & 2 deletions wiki/source/philosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Required only controller and renderer.
## Solved problems

1. [Mixins chaos and wrong usage](https://reactjs.org/blog/2016/07/13/mixins-considered-harmful.html). Mixins is good but dangerous conception. Use it carefully.
1. You can decorate Django view in so many places: urls, view, dispatch method, get/post method, form_valid mrthod etc. DjhBurger have [special place for all decorators](usage.html#decorators)
1. 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 operation will be applied partially. Example:
1. 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](usage.html#decorators).
1. 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:
```python
for user in users:
if user.is_anonymous():
Expand Down

0 comments on commit 67cf60e

Please sign in to comment.