X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..e7ffe0d783233c99ba1ec73f594f444933bb3aca:/src/stats/tasks.py?ds=sidebyside diff --git a/src/stats/tasks.py b/src/stats/tasks.py index cb2ec8363..7c9dc9666 100644 --- a/src/stats/tasks.py +++ b/src/stats/tasks.py @@ -1,12 +1,12 @@ -# -*- coding: utf-8 -*- # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # 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__) @@ -23,7 +23,4 @@ except AttributeError: @task(ignore_result=True) def track_request(piwik_args): - piwik_url = "%s%s%s" % (settings.PIWIK_URL, u"/piwik.php?", piwik_args) - conn = HTTPConnection(_host) - conn.request('GET', piwik_url) - conn.close() + urlopen("https:%s%s%s" % (settings.PIWIK_URL, "piwik.php?", piwik_args))