处理opensearch.xml
django-opensearch的Python项目详细描述
django-opensearch is a django reusable application to handle opensearch.xml
Installation
- 从git存储库获取源代码副本:git clone https://github.com/vint21h/django-opensearch.git。或者从https://github.com/vint21h/django-opensearch/tags/下载最新版本。
- 从存储库源树或解压缩的存档文件运行python ./setup.py install。或者使用pip:pip install django-opensearch。
Configuration
- 将"opensearch"添加到settings.INSTALLED_APPS。
# settings.pyINSTALLED_APPS+=("opensearch",)
- 将"opensearch"添加到URL定义中。
# urls.pyurlpatterns+=[url(r"^opensearch/",include("opensearch.urls")),]
Usage
将"opensearch_tags"加载到基本模板,并通过调用{% opensearch_meta %}将opensearch rel meta标记放置到<;head>;html标记。
{# base.html #}{%loadopensearch_tags%} <head> {%opensearch_meta%} </head>
django-opensearch settings
- OPENSEARCH_CONTACT_EMAIL
- 包含一个电子邮件地址,可以通过该地址联系描述文档的维护者。默认为""。
- OPENSEARCH_SHORT_NAME
- 包含一个简短的人类可读标题,用于标识此搜索引擎。默认为""。
- OPENSEARCH_DESCRIPTION
- 包含搜索引擎的可读文本描述。默认为""。
- OPENSEARCH_FAVICON_WIDTH
- 包含可与此搜索内容关联使用的图像宽度。默认为16。
- OPENSEARCH_FAVICON_HEIGHT
- 包含可与此搜索内容关联使用的图像的高度。默认为16。
- OPENSEARCH_FAVICON_TYPE
- 包含可与此搜索内容关联使用的图像的mimetype。默认为"image/x-icon"。
- OPENSEARCH_FAVICON_FILE
- 包含一个url,用于标识可与此搜索内容关联使用的图像的位置。默认为"favicon.ico"。
- OPENSEARCH_SEARCH_URL
- 包含用于搜索内容的django url名称。默认为"search"。
- OPENSEARCH_SEARCH_QUERYSTRING
- 包含搜索参数前的querystring。默认为"q="。
- OPENSEARCH_INPUT_ENCODING
- 包含一个字符串,该字符串指示搜索引擎支持使用指定字符编码编码的搜索请求。默认为"UTF-8"。
Licensing
django opensearch是自由软件:您可以根据自由软件基金会(free software foundation)发布的gnu通用公共许可条款(许可证的第3版或(由您选择)任何更高版本)重新分发和/或修改它。 有关完整的许可证文本,请参阅复制文件。
Contacts
项目网站:https://github.com/vint21h/django-opensearch/
author:阿列克谢·安德鲁希耶维奇<;vint21h@vint21h.pp.ua>;
有关其他作者列表,请参见作者文件。