Skip to content

Latest commit

 

History

History
84 lines (49 loc) · 1.4 KB

installation.rst

File metadata and controls

84 lines (49 loc) · 1.4 KB

Installation

Only with Python/django

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>
 ...

JS / Python Setup

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();

General Setup

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" %}