Self-hostable website analytics on Django: a straightforward collector API, dashboards, a world map, and PDF reports.
analyticsdjangodockerhandcodedpythonself-hostedsqliteviteweb-analytics
1from django.contrib import admin
2
3from .models import Property, Event
4
5
6class PropertyAdmin(admin.ModelAdmin):
7 list_display = ('id', 'name', 'user', 'total_events', 'total_page_views', 'total_clicks',)
8 list_filter = ('user__username',)
9 search_fields = ('name', 'user__username',)
10 ordering = ('user',)
11
12
13admin.site.register(Property, PropertyAdmin)
14
15
16class EventAdmin(admin.ModelAdmin):
17 list_display = ('property', 'event', 'created_at',)
18 list_filter = ('property__name', 'created_at')
19
20
21admin.site.register(Event, EventAdmin)