Contribute Media
A thank you to everyone who makes this possible: Read More

Make AngularJS play nice together with Django


Django intentionally has been designed as a pure server side framework, thus being agnostic about client side programming, except for the Django admin interface, which uses jQuery. Letting developers choose their preferred client side framework has been a wise decision by Django community. However, in most cases the de-facto standard, hence jQuery, is used. In the past years, other Javascript frameworks have emerged, namely Knockout, EmberJS, Backbone and AngularJS. They all attempt to circumvent to shortcomings of jQuery. Since Django developers are familiar with the concept of Model-View-Control, they might feel even more comfortable with one of these frameworks, rather than with jQuery.

In my proposed talk, I would like to give a short introduction into AngularJS’s two-way data-binding, which can dramatically reduce boilerplate code, otherwise required when using jQuery. Furthermore, this talk will handle the following topics: - How to render model-bound forms for AngularJS, using mixin classes to be added to the built in Django form. - How Django’s form validation can be used to pre-validate the form data on the client, using the AngularJS Model controller, but without duplicating code. - How to securely call Django view’s methods from inside an AngularJS controller, with a behaviour similar to remote procedure calls. - How to use dependency injection to separate concern for external data, either created by Django for production use, or by a mocking class when writing unit tests for browsers code. - Three-way data-binding build on top of AngularJS’s two-way data- binding using websockets for bidirectional synchronization of the browsers view model with server side data buckets.

In-depth documentation on the topics of the proposed talk can be found here: http://django-websocket-


Improve this page