Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backbone and Django, finding a better client-side architecture

I have been working with Django as backend and using jQuery for the front end. Now with web pages been so dynamic javascript has started to get more and more complicated and I feel the need of a better, more organized structure there.

I started reading about Backone and it just feels like a backend approach to frontend (since it's an MVC framework). This would make my code more structured but some functionality seems to be overlapping (i.e. models, urls, ...)

I have also read about using backbone with tastypie and django to implement a RESTful environment here. This is very cool since the app would be ready for phone development too.

now my question is how good or bad this architecture is? what pros and cons it has and if there is a simpler way of achieving a DRY client-side code (maybe following some set of rules/good practices would do)

Any personal experience is more than welcome :)

like image 990
Hassek Avatar asked Jul 29 '12 19:07

Hassek


1 Answers

I was in the same situation a few months as you are right now. Of course the number of tutorials, example projects or documentation is very low and most of them very old BUT one tutorial that I came across fishing night and day for help was this http://joshbohde.com/blog/backbonejs-and-django, was and still is at the moment the only one (that I could find) that was reusing Backbone templates into Django templates with the help of some custom template tags.

My personal experience with Django + Backbone was a good one but only lasted a few months, after that I moved to NodeJS + Backbone. I can only say that even though Django/Python is a fast programming language adding Backbone to it will be even faster (user experience) when you think you will only send (to the REST server and back) small pieces of data and not reloading the entire page on every little detail that has changed.

like image 68
Claudiu Hojda Avatar answered Sep 28 '22 13:09

Claudiu Hojda