1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from celery import shared_task
5 from django.conf import settings
7 from urllib.parse import urlsplit
8 from urllib.request import urlopen
11 logger = logging.getLogger(__name__)
16 # Retrieve piwik information
18 _host = urlsplit(settings.PIWIK_URL).netloc
19 except AttributeError:
20 logger.debug("PIWIK_URL not configured.")
24 @shared_task(ignore_result=True)
25 def track_request(piwik_args):
26 urlopen("%s%s%s" % (settings.PIWIK_URL, "piwik.php?", piwik_args))