AdPushUp ads.txt management API.
Project description
This library provides adpushup API for handling ads.txt management.
Django:
-
add it to installed apps:
INSTALLED_APPS = ( ..., 'adpushup_adstxt', ..., )
-
add your user_id and key to YOUR settings.py:
ADPUSHUP_API_USER_ID = 'test@example.com' ADPUSHUP_API_KEY = '1234'
-
OPTIONALLY add different WWW_DIR:
ADPUSHUP_WWW_DIR = '/some/dir/to/put/ads.txt/in/it/'
by default it is Djangos
ROOT_DIR + '/www' -
ADD it to your urlconf:
from adpushup_adstxt.django_views import handle urlpatterns += patterns( '', url(r'^adsTxtManagementApiByAdpushup.php', handle)),
Testing:
from adpushup_adstxt.utils import encode_uri_component
import time
import hmac
import hashlib
import requests
user_id = 'your user id'
key = 'your key'
req_time = int(time.time())
hash_params = "email={}&ts={}".format(
encode_uri_component(user_id.encode("UTF-8")), req_time)
hash = hmac.new(key, hash_params, hashlib.sha256).hexdigest()
res = requests.post(
'http://localhost:8000/adsTxtManagementApiByAdpushup.php',
dict(
data='test content',
ts=req_time,
hash=hash))
print res.status_code
print res.content
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
adpushup-adstxt-0.1.2.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file adpushup-adstxt-0.1.2.tar.gz.
File metadata
- Download URL: adpushup-adstxt-0.1.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7437575d4ad32b1c3c8efb33b974dbc222e7ebaa4645e17c0f0fd8a07ea9ba97
|
|
| MD5 |
7ac6228abc4dd42eb587b1fb8eddb385
|
|
| BLAKE2b-256 |
f6a790179933ab7969e26b050f58f525066c7ce8e00a9fc00ef3447e310aa9fa
|
File details
Details for the file adpushup_adstxt-0.1.2-py3-none-any.whl.
File metadata
- Download URL: adpushup_adstxt-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c487434fd87f3ceb6bade363962ea4059d1e1ff4fb42706d8b8bee50f22472e
|
|
| MD5 |
cd7089c1371e9c2d6d5cca3e80ae11f5
|
|
| BLAKE2b-256 |
ec098007cb624eb62d110720deda58d08ec245dfd0cd9a1057127abe6c7741a9
|