Add public PageView tracking for portal analytics.
CI / test (pull_request) Successful in 13s

Closes #3 — record successful public GET hits, show last-30-day views and top pages on the analytics report, and keep portal/admin/API paths out of the counts.
This commit is contained in:
2026-08-20 05:32:09 -05:00
parent 30ce58e610
commit b054097f3d
9 changed files with 234 additions and 7 deletions
@@ -0,0 +1,27 @@
# Generated by Django 6.1 on 2026-08-13 12:38
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('analytics', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PageView',
fields=[
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('path', models.CharField(db_index=True, max_length=512)),
],
options={
'ordering': ['-created_at'],
'indexes': [models.Index(fields=['created_at', 'path'], name='analytics_p_created_9e8b64_idx')],
},
),
]