2👍
✅
… one cannot use django template tags in the javascript code unless the code is embedded into the HTML itself …
This is incorrect. Simply make the <script>
tag point to something in your urlconf, then have the view set the Content-Type
header appropriately for JavaScript and output it.
0👍
I just setup a few datatables last week with Django.
The only requirement is that your server sends a JSON structure called aaData, containing the rows.
You can also use this full example as a basis, this is more advanced and has a few methods you have to cipy in your projects (datatables.utils) :
http://www.datatables.net/development/server-side/django
- [Answered ]-Django variable in template resulting in SQL query
- [Answered ]-Django model form doesn't populate when instance=object is set
- [Answered ]-Django app with long running calculations
- [Answered ]-Django model formset performance
Source:stackexchange.com