X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..ecd1f5bc214a8ba61b65d4d00a7e7d09a8c8fa3a:/src/stats/tasks.py?ds=sidebyside diff --git a/src/stats/tasks.py b/src/stats/tasks.py index d0aeb7ae5..21f2470cc 100644 --- a/src/stats/tasks.py +++ b/src/stats/tasks.py @@ -3,9 +3,10 @@ # from celery.task import task from django.conf import settings -from http.client import HTTPConnection import logging from urllib.parse import urlsplit +from urllib.request import urlopen + logger = logging.getLogger(__name__) @@ -22,7 +23,4 @@ except AttributeError: @task(ignore_result=True) def track_request(piwik_args): - piwik_url = "%s%s%s" % (settings.PIWIK_URL, "/piwik.php?", piwik_args) - conn = HTTPConnection(_host) - conn.request('GET', piwik_url) - conn.close() + urlopen("%s%s%s" % (settings.PIWIK_URL, "piwik.php?", piwik_args))