Giter Site home page Giter Site logo

rest2backbone's Introduction

Intro

This project aims to made easier to develop django application with REST API and rich clients, that are using this API via backbone.js. In django it uses djangorestframework to quickly define RESTful API.

Key features:

  • Generates models and collection definitions in JS from resources and models definitions in django.
  • Backbone Models should contain (as per models/resources definitions in Django):
  • default values
  • validations
  • support to load values from HTML form
  • Collections:
  • support paging and searches and ordering
  • special 'index' collections - just ID and representation of object - can be used in dynamic selects, autocompletes etc.
  • Can generate forms templates (based on models and resources definitions) for use in pages (also read only forms)
  • Forms can:
  • update validation result to form
  • save modified form to server (via rest API - using Backbone models and colections).
  • A sample application - showing how it should be used.

Quick Start

Get code from GitHub

Extract

Get dependencies - django, djangorestframwork

pip -r requirements.pip

Load sample data ./manage.py loaddata sample_data.json

Run server

./manage.py runserver

In browser open http://localhost:8000/

In browser (Firefox/Chrome) open developer tools - to see API requests to server - on load/change of models

Look into sample_app directory to see how to use.

More Info

More info will be on project page on my web

Versions:

1.0 - first release

1.0.1 - minor fixes, added support for Textarea widget in templates

1.1 - revamped dynamic widgets to more flexible and extensible model, save - use PATCH when possible

1.2 - more refactoring of dynamic widgets, DynamicEditor (edit related object in place), small fixes

1.2.1 - setup script

1.2.2 - small fixes in forms-api

1.2.3 - added possibility to defer save in FormView, DynamicEditor widget

1.2.4 - some changes to JS - better handling of errors when server is not responding

1.2.5 - fixed to work with django 1.5+ and newer django-rest-framework

License:

BSD license (same as Django)

rest2backbone's People

Contributors

izderadicka avatar

Watchers

Allen Chen Jinlong avatar James Cloos avatar  avatar

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.