Backbone.js and Django for a Faster WebUI

Author

Leafy Chat

  • Web frontend for IRC
  • Done in Django Dash (2008?)

Grove

Chat Systems

  • Built a lot of them
  • Leafy chat - only used jQuery, lots of javascript
  • Using Backbone in Grove

Examples

  • Show an example of using jQuery to build UI.
  • Embedded HTML in javascript.

Backbone and Grove

  • The UI looks the same
  • Backbone gives MVC style, in a single file.
  • You can roll it yourself, making it easy to get started.
  • Not actually MVC, actually Models, Templates, and Views

Models

Collections

Views

  • Highlight the Backbone Views on the Grove app page.

  • Demonstrates Backbone Event binding
    • Creates the view from the model data
    • Bind updating view when the model changes

Templates

Additional Goodies

Sync

Events

  • Can update multiple views for a single model.
  • App.trigger(‘messageAdded’, ...)

Router

  • Will trigger Events based upon the hash

Questions

  • Do you feel bad that your Django app is now Javascript?
    • No, this is how apps are going.