Appodeal集成的Django视图
appodeal的Python项目详细描述
用于Appodeal集成的django应用程序。
安装
- Add ‘appodeal’ to INSTALLED_APPS
- Add url(r’^/’, include(‘appodeal.urls’)), to urls.py
- (optional) Add APPODEAL_SECRET_ANDROID to settings.py
- (optional) Add APPODEAL_SECRET_IOS to settings.py
- Add APPODEAL_REWARD_CREATE_HANDLER to settings.py
- Run python manage.py migrate.
- Add the callback URL in Appodeal “{https://example.com/reward/}?data1={data1}&data2={data2}”
处理程序
它将被调用:
output: | A dict with the decrypted data from Appodeal |
---|---|
rewards: | A appodeal.RewardQuerySet with all the records with the same impression_id. |
应返回一个字符串,该字符串将存储为奖励记录中的结果。
如果处理程序失败,异常表示将存储为结果。
输出示例
{'user_id':user_id,'amount':amount,'currency':currency,'impression_id':impression_id,'timestamp':timestamp,'hash':hash,'output':output}
运行测试
./runtests.py
生成/发布
python setup.py sdist bdist_wheel twine upload dist/*