Middleware
Setup
Add "django_umami.middleware.TrackAllViewsMiddleware"
to your django settings. Example below.
Example
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django_umami.middleware.TrackAllViewsMiddleware" ## ADD THIS LINE
]
And that's it! You are now tracking all views automatically.
Be aware, this may cause extra latency between requests especially if your django server location is far away from the Umami server location.
Settings
Of course, we allow you to modify who you want to track :)