Speaker Jen Zajac
Time 2017-08-04 09:15
Conference PyCon Au 2017

Django & JavaScript

History

  • ECMAScript 4 never standardised.
  • jQuery.
  • Template libraries. Some inspired by Django template language.
  • Frameworks. AngularJS, etc.
  • Seperate templates required for Django and JS.
  • Django Compressor and Django Pipeline.
  • Django REST framework, Tastypie.
  • ECMAScript 6 - officially called ECMAScript 2015.
  • Transpilation. For the impatient. Run ECMAScript 6 in ECMAScript 5.
  • Angular2 -> Angular, Angular 1 -> AngularJS.
  • React + Redux.
  • NPM, bower, Yarn. Most people use NPM, as means you can use one tool.
  • Grunt, Gulp, Browserify, Rollup, Webpack.
  • Typescript, Flow.

ECMAScript 6

  • Let/const instead of var.
  • String interpolation.
  • Multi line strings.
  • Arrow functions.
  • Module imports.
  • Classes.
  • Default values for parameters.
  • You don’t need to try out every new feature.

Django

  • Django webpack loader. Less invasive then Django Pipline.
  • Decouple frontend and backend.
  • Single page application.
  • Automatic provisioning.
  • Django has excellent documentation.
  • Python react.
  • Django channels.
  • Django as a microservice.

Which one?

  • Building a website or webapp?
  • JS for decorative or functional purposes?
  • Do you need batteries included? If using framework, need to respect their decisions?

Competition: node.js

  • Contenders:

    • sails.js (closest to Django).
    • Meteor.
    • Keystone.
  • Smaller communities, less mature.
  • One language.
  • First class async support.
  • Isomorphic render.
  • Websockets - good support.

Future

  • New functionality all the time.
  • Notification APIs. Push notifications to phone.
  • Offline Django.
  • Django and JS are good friends.