One of the pillars of Django is DRY principle and hardcoding your urls in Javascript is violating that principle. Moreover, building parametrized urls on the fly is error-prone and ugly. # Where to ...
javascript-settings is a Django application that provides a way of passing values backend from Django applications to JavaScript in templates. def javascript_settings(): return { 'page_title': 'Home', ...