Statistics
This package contains all views related to statistics
Statistics Actions
This module contains view actions related to pages.
- integreat_cms.cms.views.statistics.statistics_actions.get_total_visits_ajax(request: HttpRequest, region_slug: str) JsonResponse [source]
Aggregates the total API hits of the last 14 days and renders a Widget for the Dashboard.
- Parameters:
request (HttpRequest) – The current request
region_slug (str) – The slug of the current region
- Returns:
A JSON with all API-Hits of the last 2 weeks
- Return type:
JsonResponse
- integreat_cms.cms.views.statistics.statistics_actions.get_visits_per_language_ajax(request: HttpRequest, region_slug: str) JsonResponse [source]
Ajax method to request the app hits for a certain timerange distinguished by languages.
- Parameters:
request (HttpRequest) – The current request
region_slug (str) – The slug of the current region
- Returns:
A JSON with all API-Hits of the requested time period
- Return type:
JsonResponse
Statistics View
Views related to the statistics module
- class integreat_cms.cms.views.statistics.statistics_view.AnalyticsView(**kwargs)[source]
Bases:
TemplateView
View for the statistics overview.
- __init__(**kwargs)[source]
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- extra_context = {'current_menu_item': 'statistics'}[source]
The context dict passed to the template (see
ContextMixin
)
- get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponseRedirect [source]
Render statistics of access numbers tracked by Matomo
- Parameters:
request (HttpRequest) – The current request
*args (Any) – The supplied arguments
**kwargs (Any) – The supplied keyword arguments
- Returns:
The rendered template response
- Return type:
HttpResponseRedirect
- get_template_names()[source]
Return a list of template names to be used for the request. Must return a list. May not be called if render_to_response() is overridden.
- render_to_response(context, **response_kwargs)[source]
Return a response, using the response_class for this view, with a template rendered with the given context.
Pass response_kwargs to the constructor of the response class.
- response_class[source]
alias of
TemplateResponse
- template_name = 'statistics/statistics_overview.html'[source]
The template to render (see
TemplateResponseMixin
)