A simple Django package to render Plausible Analytics html tag
Project description
Django Simple Plausible
A dead simple package to add Plausible Analytics html tag to your HTML. Tested with Python 2.7 and 3.8. Tested with Django 1.11 and 3.2.
Usage
-
Install package:
pip install django_simple_plausible -
Add
django_simple_plausibleto yourINSTALLED_APPSin settings.py -
ADD
PLAUSIBLE_SITESandPLAUSIBLE_SCRIPT_URLkeys and values to your settings.py. Or enter the corresponding values as template tag parameters, as shown below.
...
PLAUSIBLE_SITES = "example.com"
PLAUSIBLE_SCRIPT_URL = "https://example.com/js/plausible.js"
...
- add the following template tags to your site html:
{% load plausible %}
{% plausible %}
Configuring details
PLAUSIBLE_SITEScan be a comma separated list without spaces, if you want to use that feature of Plausible
PLAUSIBLE_SITES = "example.com,yoursite.com"
PLAUSIBLE_SCRIPT_ASYNC_TAGis an optional setting. It can be used to render the script tag with theasyncattribute instead ofdefer
PLAUSIBLE_SCRIPT_ASYNC_TAG = True
- Systemwide settings can be overridden giving the template tag some optional parameters:
{% plausible plausible_sites="mysite.com" script_url="https://mysite.com/plausible.js" async_tag=True %}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_simple_plausible-0.0.5.tar.gz.
File metadata
- Download URL: django_simple_plausible-0.0.5.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22758eb3817345677feebdf980947a7a64955d35da23d711e31d5ba0d6c5e4ad
|
|
| MD5 |
4d04de366d8d28a12d3856d35f031ac6
|
|
| BLAKE2b-256 |
3481716349ee634fe291501ce69c50a5d6904db307ad5af62647e1d807867d09
|
File details
Details for the file django_simple_plausible-0.0.5-py2.py3-none-any.whl.
File metadata
- Download URL: django_simple_plausible-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f9f3158b0da68d6612eb50374b866f77c5fe5f924066ac821136c56ad0bbfb5
|
|
| MD5 |
99610f5f4a36ba7d1bffaf31017c8e8d
|
|
| BLAKE2b-256 |
3649bbc1802c118383a8eadc9ba40cb5828995efd008295638179d02c686db15
|