Giter Site home page Giter Site logo

django-dry-project's Introduction

Django DRY Project

A Django project with samples code strictly DRY (DON'T REPEAT YOURSELF)

Features

CRUD (Create Retrieve Update Delete)

CRUD are operations that most project implements. Django Rest Framework can be used for this purpose, to develop Rest API Endpoint.




Utils

Utils folder can be used to store utils method/class

  • Create for each plugin, one utils file

Pagination

Client_PageNumberPagination class can be used to enable client custom pagination size.

  • <url>?page_size=20 Get 20 items at time, get page=1 (default)
  • <url>?page=2 Get the page number, get page_size=10 (default)
  • <url>?page_size=20&page=2 Get 20 items at time, get page=2

BrowsableAPIRenderer DEBUG MODE ONLY

Debug_BrowsableAPIRenderer class can be used to use browsable api ONLY into DEBUG MODE.

django-dry-project's People

Contributors

giuseppenovielli avatar

Stargazers

Jae Hyuck Sa  avatar fF avatar Mohammad Fayaj avatar  avatar Duver avatar  avatar

Watchers

 avatar

Forkers

digicornio

django-dry-project's Issues

DRF wrongly moves validation business logic from models to views

Start Django Rest Framework 3.0 announcement Model.full_clean() is not called before save instance into db.

This policy moves validation business logic from models to views and break DRY purpose.

encode/django-rest-framework#7850 (comment)

Workaround
ValidateModelSerializer

SPECS
It enable developers to run model.full_clean(), when serializers.is_valid() is called.
It also have limited support to nested writable serializer. Developers can pass into **kwargs parameters, other foreignKey not yet saved into db.

It is a valid compromise to help DRY purpose?

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.