is it really as hopeless as the answer makes it sound?
To a large extent. But, since I work on a site that used to be based on Django, but is now becoming the base, I can offer several considerations:
URL routing as / italy / 1-week / from-500-to-1000 / - I now need to write two sets of routing codes: one in Django urls.py and one in the Backbone router to get the country / duration / parameters prices?
Yes, but there are ways to minimize duplication. The approach we took was for Django to spit out all URLs as JS variables to our main HTML page template:
<script> URLS.report_error = "{% url app.log_client_error_view %}"; URLS.access_file = "{% url app.access_file_view 12345 %}"; </script>
Now we have a pattern of using 12345 for parameters in each URL that we generate; this makes it easy to translate this URL into a regular expression Backbone route, because we can basically replace 12345 with ([^/]+) .
In the interest of full disclosure, we have a bunch of routing regular expressions that are written โmanually,โ but this is not because we were unable to automate them; it's just that we moved away from the side of Django, so we have no reason to clear this code. If you want to get solid support information for both, you should have a fairly simple / simple translation.
Parameter-based data filtering - do I need to write two separate ways to do this: one in views.py and one in Backbone? (I assume that I can at least use one API for both calls.)
This is an almost inevitable problem on any site, not just Backbone / Django. You must filter the data on the server side, because you can never trust the client side (for example, the user can disable JS). At the same time, filtering only on the server side is sooo 1990, so you need to create (duplicate) logic for filtering on the client side (so you can tell the user "you forgot to provide the X field", without waiting for the server to return to the server) .
However, there are ways to limit this duplication. I myself have not worked on this subject, but I know that an employee managed to use Django forms in an odd way (he took the Django form and then parsed them a bit before using them as a template for the Backbone View). This did not completely eliminate the duplication, and, unfortunately, I do not remember any details, but it helped.
Rendering in templates - do I need to write one list template for Django and the other for Backbone, or can both use the same templates?
Handlebars templates have similar syntax to Django templates, if all you do is variables ( {{foo}} ). If you want to share the logic between them, they have a slightly different syntax ( {% if foo %} vs. {{#if foo}} ), but they are close enough that if you don't mind doing a little parsing work, You can easily convert one to another.
So yes, you work hard to support a very small subgroup of your users (those with browsers that cannot support Backbone). I highly recommend that you look at the statistics of your userโs browser somewhere like Google Analytics (or see general statistics on the Internet if your site is not already up) to decide whether all these problems really are behind such a small percentage of your user base, Without statistics you cannot know how small this percentage is, and obviously, a key factor in this decision.
For us, the choice was obvious: we need our users to use browsers made in this century (which is largely related to the database), and just go to all Backbone. But if this choice is not so obvious to you ... good luck trying to dry your Django and Backbone code :-)