Skip to main content

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

  1. Install package: pip install django_simple_plausible

  2. Add django_simple_plausible to your INSTALLED_APPS in settings.py

  3. ADD PLAUSIBLE_SITES and PLAUSIBLE_SCRIPT_URL keys 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"

...
  1. add the following template tags to your site html:
{% load plausible %}
{% plausible %}

Configuring details

  • PLAUSIBLE_SITES can 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_TAG is an optional setting. It can be used to render the script tag with the async attribute instead of defer
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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_simple_plausible-0.0.5.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

django_simple_plausible-0.0.5-py2.py3-none-any.whl (2.9 kB view details)

Uploaded Python 2 Python 3

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

Hashes for django_simple_plausible-0.0.5.tar.gz
Algorithm Hash digest
SHA256 22758eb3817345677feebdf980947a7a64955d35da23d711e31d5ba0d6c5e4ad
MD5 4d04de366d8d28a12d3856d35f031ac6
BLAKE2b-256 3481716349ee634fe291501ce69c50a5d6904db307ad5af62647e1d807867d09

See more details on using hashes here.

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

Hashes for django_simple_plausible-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0f9f3158b0da68d6612eb50374b866f77c5fe5f924066ac821136c56ad0bbfb5
MD5 99610f5f4a36ba7d1bffaf31017c8e8d
BLAKE2b-256 3649bbc1802c118383a8eadc9ba40cb5828995efd008295638179d02c686db15

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page