My question is pretty simple: Currently the stack i use is django+coffeescript.
Is coupling django, backbone js a good idea? What advantage does it offer? Could anyone take me through the pros and cons.
PS: I know backbone js being an MVC.
Backbone.js offers an MVC way of doing things on the client-side. You can of course mix coffeescript with backbone quite easily.
If your app has to perform quite a lot of stuff on the client-side, adopting backbone is going to let you achieve this in a cleaner, more structured and elegant way.
We use backbone+django extensively for an app, however, django alone doesn't really mix well with backbone, as most of the template system and some of the view system become superfluous when you communicate over a REST-api. Luckily you can easily add an API to django through piston, tastypie or our favorite django-rest-framework.
A problem is the doubled code-base, you need to define models and potentially form validation logic twice, in different frameworks. You might want to look at node.js as a replacement for django on the backend to be able to reuse logic on both sides of the http. Perhaps take a look at capsule from andyet.com (Henrik Joreteg to be precise) for reusing backbone logic across client and server.
A new kid on the block seems to be djangbone (https://github.com/af/djangbone) makes it really easy to use the Django ORM with backbone!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With