GithubHelp home page GithubHelp logo

juanmitaboada / django-angular Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jrief/django-angular

0.0 1.0 0.0 2.11 MB

Let AngularJS play well with Django

Home Page: http://django-angular.awesto.com/

License: MIT License

JavaScript 47.60% Python 47.88% CSS 2.06% HTML 2.46%

django-angular's Introduction

django-angular

Let Django play well with AngularJS

Build Status PyPI version Python versions Software license Twitter Follow

Breaking News

On 2017-11-17 django-angular version 2.0 has been released.

Backward Incompatibility

To be compliant with other libraries such as djangorestframework, server-side responses on rejected forms use error code 422, rather than 200. If you use your own form controllers, adopt them accordingly. The JSON format used to communicate errors downstream has changed slightly.

New Features

For a smoother transition path, django-angular added two directives in version 2.0:

<form djng-endpoint="/path/to/endpoint">...</form>, which can be used to upload form data to the server. It also populates the error fields, in case the server rejected some data.

<djng-forms-set endpoint="/path/to/endpoint"><form ...>...</form>...</djng-forms-set> Similar to the above directive, but rather than validating one single form, it validates a set of forms using one shared endpoint.

A promise chain has been introduced. Buttons used to submit form data and then proceed with something else, now can be written as:

<button ng-click="do(update()).then(redirectTo('/path/to/other/page'))">Label</button>

Documentation

Detailed documentation on ReadTheDocs.

Demo on how to combine Django with Angular's form validation.

Please drop me a line, if and where you use this project.

Features

  • Seamless integration of Django forms with AngularJS controllers.
  • Client side form validation for Django forms using AngularJS.
  • Let an AngularJS controller call methods in a Django view - kind of Javascript RPCs.
  • Manage Django URLs for static controller files.
  • Three way data binding to connect AngularJS models with a server side message queue.
  • Perform basic CRUD operations.

Future Plans

A next big change to django-angular is to add support for Angular2 and/or 4. This will require additional development time from my side, so please consider to fund this and other upcoming features using Gratipay.

Latest Changes

2.0 (2017-11-17)

2.0

  • To be compliant with other frameworks, Ajax responses from invalid form submissions, now respond with a HttpResponseBadRequest (status code 422) rather than with a HttpResponse (status 200). This requires to adopt the form response views and the response handlers in JavaScript files, submitting the form data.
  • No more need to add a customized controller for uploading form data to the server. Instead add the directive djng-endpoint="/path/to/endpoint" to a form and submit the form's content using an action event.
  • New AngularJS directive djng-forms-set, usable to validate and submit more than one form.
  • AngularJS directive for the button-element, usable to create a chain of action promises for form submissions.
  • Add support for AngularJS version 1.6 by replacing deprecated occurrences of $http(...).success(...) against $http(...).then(...).
  • Sekizai's postprocessor module_list and module_config are deprecated and will be removed, since it is easier to fulfill the same result using Sekizai's templatetag with_data.
  • Radio input fields do not require the DjNg directive validate-multiple-fields anymore.

License

Copyright © 2017

MIT licensed

django-angular's People

Contributors

adrienbrunet avatar agdude avatar andreyoparin avatar antonofthewoods avatar asnoeyink avatar calebj avatar dkopitsa avatar fabiomontefuscolo avatar jamesbrobb avatar jaxer avatar jkosir avatar jonaswre avatar jrief avatar jshridha avatar k-funk avatar ka7eh avatar mtyaka avatar nerade avatar omarkhan avatar potpath avatar racitup avatar rfleschenberg avatar robbyt avatar rolo avatar stav avatar thedrow avatar thomasfillon avatar ubica avatar viaregio avatar werdes72 avatar

Watchers

 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.