Install with:
pip3 install django-partitialajax
Than put partitialajax into your INSTALLED_APPS:
INSTALLED_APPS = [
...
partitialajax
]
Add the JS libary to each page you have Partitials:
...
{% static 'partitialajax/index.js' %}
</head>
...
You can also use the js src to build your own javascript set for every page
Install with
pip3 install django-partitialajax
npm install django-partitialajax --save
Tipp: If you use webpack for your js code use the django-webpack-loader libary.
To use the "autodiscover" for elements with partitial loading use the following JS code:
import PartitialAjax from "django-partitialajax";
PartitialAjax.initialize();
You can define a partitial without a line of your own js code:
{% load partitialajax %}
{% direct_partitial ".content" %}
All options, see: :ref:`partitial-ajax-options` can be set as element Attribute:
{% load partitialajax %}
{% direct_partitial ".content" url:"remotepath" %}