Code Monkey home page Code Monkey logo

djburger's Introduction

DjBurger

DjBurger logo

Build Status Documentation PyPI version Status Code size License

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

What DjBurger do?

  • Split Django views into steps for secure and clean code.
  • Provide built-in objects for all steps.
  • Integrates this many side libraries like Django REST Framework and Marshmallow.

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 :)

djburger's People

Contributors

inokenty90 avatar orsinium avatar qwinpin avatar tivnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

djburger's Issues

Project decisions: python versions support

I haven't seen a clear policy about python versions this project supports, so I may be wrong.

Concern

I have seen that this project uses six, so I assumed that it is currently supporting python2.
Which is not a good thing

Problems

Supporting python2 can cause project maintainers several problems:

  1. Late language features support, like typing, etc
  2. A lot of compat fixes, usually code that support both python version is full of compat pieces and even sub-frameworks on large code bases
  3. Libraries limitation, some libraries are already python3+ (including django)

I would like to highlight the biggest problem for me: typing.
I see, that currently you do not use typing, but that's not that good.

I, as a user, want to get typing from the business logics framework for free.
And if I don't use types - by my choice - and my developer experience won't suffer.

And typing will make a lot of features even more awesome.
Like validators, schemes, etc.

End of support

django already drops python2 support, python2 eof is in 2020.

Solution

Drop python2 support.
Later it is possible to add type annotations and mypy support.

P.S. We are also working on types for django: you can join us here https://github.com/TypedDjango

Architecture decisions: plugins vs monorepo

This project seems really interesting.

But, I found some architecture decisions questionable.
I would like to ask some clarifying questions.

Monolith vs Plugins

The first thing that came to my eye is that you store all in one.
Everything is inside the core. Which is a rather bad idea in my point of view. Reasons:

  1. Building the plugin system from the ground up. It is really hard to build the plugin system if it was not designed from the beginning. And I see it this software will surely have a lot of plugins/extensions
  2. It is hard to version your software properly, imagine that you have to support several version of drf and several version of django and marshmallow. All in one package. This will have versioning/packaging issues
  3. Hard to follow up. If someone needs to create a custom plugin, it will be hard to do so. Since it will require going deeply into the core
  4. Hard to release. Releasing small peaces of software is easy. Releasing big peaces of software is hard. You have bigger tasks, bigger problems, many pending bug reports, PRs, etc

Solution

I see a clear separation between:

  • validators
  • adapters (drf, marshmellow, etc)
  • form wrappers
  • renderers and parsers
  • some others

Each of these packages can be released independently. See https://github.com/dry-rb for the reference.

The only things to be very strict about is public contracts and semantic versioning.
I would also suggest to make a github organization for this task.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.