| 1 |
Django Any-JS |
| 2 |
============= |
| 3 |
|
| 4 |
Description |
| 5 |
----------- |
| 6 |
|
| 7 |
Django-Any-JS helps you at including any combination of JavaScript/CSS |
| 8 |
URLs in your site, with readable settings and template tags. |
| 9 |
|
| 10 |
Usage |
| 11 |
----- |
| 12 |
|
| 13 |
In your settings: |
| 14 |
|
| 15 |
:: |
| 16 |
|
| 17 |
INSTALLED_APPS = [ |
| 18 |
..., |
| 19 |
"django_any_js", |
| 20 |
..., |
| 21 |
] |
| 22 |
ANY_JS = { |
| 23 |
"DataTables": { |
| 24 |
"js_url": "/javascript/jquery-datatables/dataTables.bootstrap4.min.js", |
| 25 |
"css_url": "/javascript/jquery-datatables/css/dataTables.bootstrap4.min.css", |
| 26 |
} |
| 27 |
} |
| 28 |
|
| 29 |
In your template: |
| 30 |
|
| 31 |
:: |
| 32 |
|
| 33 |
{% load any_js %} |
| 34 |
{% include_js "DataTables" %} |
| 35 |
{% include_css "DataTables" %} |