从管理面板管理ads.txt文件的简单django应用程序
django-ads-txt的Python项目详细描述
Django广告文本
这是一个基本的django应用程序,用于管理基于iabtech lab specification
要求
python 2.7、3.5或pypy。
Django 1.9或更高。
安装
使用您喜爱的python安装程序从pypi安装它:
pip install django-ads-txt
或者从应用程序站点获取源代码:
https://github.com/flyingelephantlab/django-ads-txt/
将
'ads_txt'
添加到INSTALLED_APPS设置中。运行
migrate
管理命令要在django站点上激活ads.txt生成,请将此行添加到URLconf:
url(r'^ads\.txt',include('ads_txt.urls')),
- 添加需要从“管理”面板中显示的域
规则
这些指令被编码为格式化的纯文本对象,如下所述。完整的 此格式的语法说明:
<Domain #1>, <Account ID #2>, <Account type #3>, <Authority ID #4>
Field | Description |
---|---|
Domain (Required) | Domain name of the advertising system |
Account ID (Required) | The identifier associated with the seller or reseller account |
Account type (Required) | Type of Account/Relationship. It has two values ^{ |
Authority ID (Optional) | An ID that uniquely identifies the advertising system within a certification authority |
示例:
example.com, 108933, DIRECT, 7857hf1d2fr6d8b34 opexample.com, [538220672 - CC], RESELLER, 6a69ec356744c6 opexample.com, [537120668 - CC], RESELLER, 6a69ec356744c6 ex.com, 7118, RESELLER
缓存
您可以选择缓存ads.txt的生成。在Django设置文件中添加或更改ADSTXT缓存超时设置(以秒为单位):
ADSTXT_CACHE_TIMEOUT=60*60*24
错误和功能请求
由于您的里程可能会有所不同,因此请毫不犹豫地发送功能请求和错误报告:
https://github.com/flyingelephantlab/django-ads-txt/issues