Integration with other tools ============================ Django Pipeline --------------- If you want to compress Django ezTables with `Django Pipeline`_, you should change the way you load it. First add jQuery, Django.js and jQuery Datatables (and optionnaly bootstrap support) to your pipelines in your ``settings.py``: .. code-block:: python PIPELINE_JS = { 'base': { 'source_filenames': ( '...', 'js/libs/jquery-2.0.0.js', 'js/djangojs/django.js', 'js/libs/datatables/jquery.dataTables.js', 'js/libs/datatables/datatables.bootstrap.js', '...', ), 'output_filename': 'js/base.min.js', }, } Add Datatables Bootstrap CSS to your CSS pipeline: .. code-block:: python PIPELINE_CSS = { 'base': { 'source_filenames': ( '...', 'css/datatables.bootstrap.css', '...', ), 'output_filename': 'js/base.min.css', }, } Instead of using the ``django_js`` template tag: .. code-block:: html+django {% load js %} {% django_js %} you should use the ``django_js_init`` and include your compressed bundle: .. code-block:: html+django {% load js compressed %} {% django_js_init %} {% compressed_js "base" %} RequireJS ---------- Django ezTables works with `RequireJS`_ but it requires some extras step to do it. Preloading prerequisites ~~~~~~~~~~~~~~~~~~~~~~~~ You should use the ``django_js_init`` template tag before loading your application with `RequireJS`_. .. code-block:: html+django {% load js %} {% django_js_init %} It works with `django-require`_ too: .. code-block:: html+django {% load js require %} {% django_js_init %} {% require_module 'main' %} path and shim configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~ You should add extras paths and shim configurations for Django.js and Datatables: .. code-block:: javascript require.config({ paths: { 'jquery': 'libs/jquery-2.0.0', 'django': 'djangojs/django', 'datatables': 'libs/datatables/js/jquery.dataTables.min', 'datatables.bootstrap': 'libs/datatables/js/datatables.bootstrap' }, shim: { 'bootstrap': { deps: ['jquery'], exports: '$.fn.popover' }, 'django': { "deps": ["jquery"], "exports": "Django" }, 'datatables': { deps: ["jquery"], "exports": "$.fn.dataTable" }, 'datatables.bootstrap': { deps: ["datatables"] } } }); Paths are relative to ``{{STATIC_URL}}/js``. Adapt it to your configuration. .. _`Django Pipeline`: https://github.com/cyberdelia/django-pipeline .. _RequireJS: http://requirejs.org/ .. _django-require: https://github.com/etianen/django-require