Skip to main content
Simple Analytics logo

Django Plugin

Want privacy friendly analytics for Django? You're at the right place.

You need an account on Simple Analytics to see your stats collected by this plugin.

Installing it

Install the plugin:

pip install simpleanalytics

Using it

Add the package to the INSTALLED_APPS:

INSTALLED_APPS = [
   ...,
   simpleanalytics,
]

Next use the templatetag in your template:

<!DOCTYPE html>
{% load static simpleanalytics_tags %}
<html>
	<head>
		<meta charset="utf-8">
		<title>{% block page_title %}{{ site.name }}{% endblock %}</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    ...
    {% simpleanalytics_sync %}
    ...
    </head>
</html>

This will translate to roughly this:

<!DOCTYPE html>

<html>
	<head>
		<meta charset="utf-8">
		<title>brwnppr.com</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    ...
    <script type="text/javascript" src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
    ...
    </head>
</html>

More

This app has four templatetags:

  • simpleanalytics_sync
  • simpleanalytics_async

simpleanalytics_sync converts to a plain <script> tag without the async keyword.

simpleanalytics_async converts to a plain <script> tag with the async keyword.

Compatibility

Tested on Django 2.2, but we think this should run on any recent Django deployment. Please raise an issue when it doesn't.

Metadata

Release files for simpleanalytics 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simpleanalytics 1.0.8
File Size Uploaded
simpleanalytics-1.0.8.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simpleanalytics 1.0.8
File Interpreter ABI Platform
simpleanalytics-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / simpleanalytics-1.0.8.tar.gz

Download URL simpleanalytics-1.0.8.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5f5bf8dd862036d385c759c8fdb6bae8318fc4393b62dc31d04a74a33d97cc84
BLAKE2b-256 checksum
How to use checksums
5977bc797953d01fcbff9450715a39a73ef1803a2927e5bced67bd46f36268c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / simpleanalytics-1.0.8-py3-none-any.whl

Download URL simpleanalytics-1.0.8-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe5d595ba65fe14c33ddd5d81e577af06a3d2318769860ea6368127a1e530aa6
BLAKE2b-256 checksum
How to use checksums
df89e4e9af75a64158f726d3a8a7b17f3f9fd5621a2f1ae9d96dd1a34754902c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page