fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
97c8c6d
)
Stats fix.
author
Radek Czajka
<rczajka@rczajka.pl>
Thu, 28 Nov 2019 22:58:12 +0000
(23:58 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Thu, 28 Nov 2019 22:58:12 +0000
(23:58 +0100)
src/stats/tasks.py
patch
|
blob
|
history
diff --git
a/src/stats/tasks.py
b/src/stats/tasks.py
index
d0aeb7a
..
7c9dc96
100644
(file)
--- 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 celery.task import task
from django.conf import settings
-from http.client import HTTPConnection
import logging
from urllib.parse import urlsplit
import logging
from urllib.parse import urlsplit
+from urllib.request import urlopen
+
logger = logging.getLogger(__name__)
logger = logging.getLogger(__name__)
@@
-22,7
+23,4
@@
except AttributeError:
@task(ignore_result=True)
def track_request(piwik_args):
@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("https:%s%s%s" % (settings.PIWIK_URL, "piwik.php?", piwik_args))