Skip to main content

Handle opensearch.xml

Project description

OpenSearch application for django

This application provide a way to integrate the OpenSearch XML file to a django application.

[[TOC]]

Installation

Install the package pip install django-opensearch-xml

Configuration

  • Add "opensearch_xml" to settings.INSTALLED_APPS.
    INSTALLED_APPS = [
      ...,
      "opensearch_xml",
      ...
    ]
    
  • Add "opensearch_xml" to URLS
    from django.urls import path, include
    
    
    urlpatterns = [
      ...,
      path("opensearch/", include("opensearch_xml.urls")),
      ...
    ]
    

Settings

Add OPENSEARCH_XML_<params> to the application settings

OPENSEARCH_XML_CONTACT_EMAIL = ""
Email address of the maintainer the application
OPENSEARCH_XML_SHORT_NAME = ""
Brief human-readable name of the search engine
OPENSEARCH_XML_DESCRIPTION = ""
Human-readable description of the search engine and its contents
OPENSEARCH_XML_FAVICON_WIDTH = 16
Width of the favicon
OPENSEARCH_XML_FAVICON_HEIGHT = 16
Height of the favicon
OPENSEARCH_XML_FAVICON_TYPE = "image/x-icon"
Type of the icon
OPENSEARCH_XML_FAVICON_FILE
File on the favicon, relative to the path referenced in STATIC_PATH
OPENSEARCH_XML_SEARCH_URL = "search"
Django URL name of the search. This URL will be passed to the `reverse()` function
OPENSEARCH_XML_SEARCH_QUERYSTRING = "q="
Querystring used to prepend the search parameters
OPENSEARCH_XML_INPUT_ENCODING = "UTF-8"
Encoding for the querystring

Usage

Add the template tag {% opensearch_xml_meta %} into the page <head>.

{% load opensearch_xml_tags %}
<html lang="en">
<head>
    <title>My title</title>
    ...
    {% opensearch_xml_meta %}
</head>
<body>
...
</body>
</html>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_opensearch_xml-0.3.2.tar.gz (12.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_opensearch_xml-0.3.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file django_opensearch_xml-0.3.2.tar.gz.

File metadata

  • Download URL: django_opensearch_xml-0.3.2.tar.gz
  • Upload date:
  • Size: 12.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for django_opensearch_xml-0.3.2.tar.gz
Algorithm Hash digest
SHA256 13a4ae155febc8c00bbcf6aa183a44213da21f3b12e8a1fa25844a028433e148
MD5 df9dc84cba736d867b7d4f4adfee1e9b
BLAKE2b-256 e0d47f85cd7fe73a3881bea062c526a346c3b2ccdc06821beae8a3fb72c82822

See more details on using hashes here.

File details

Details for the file django_opensearch_xml-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_opensearch_xml-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2c4a7a28139a2e9ea6dbfef49c2621aa0a9ff44120f963106e42b231c4b5978
MD5 67b1e296b25b9bad98eaa4f8088aaeb8
BLAKE2b-256 b4b2c2d6e3734539069c95134fc387a33f6a793aa666be1c699639c891217e4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page