Skip to main content

Latest version on Pypi Downloads from Pypi

Build Status - develop branch Coverage of the code

Django Search Engine Keywords Highlighter,

is a middleware for Django providing the capacities to highlight the user’s search keywords if he is coming from a search engine like Google, Yahoo or a custom search form plugged in your Website.

It retrieves the keywords of the search and decorate them with a span markup containing the classes highlight term-X for CSS makuping.

Installation

First of all you need to install BeautifulSoup >= 4.0.

Then install the package in your PYTHON_PATH by getting the sources and run setup.py or use pip.

$ pip install -e git://github.com/Fantomas42/django-sekh.git#egg=django-sekh

Usage

In your settings file, simply add this middleware at the end of the list.

MIDDLEWARE_CLASSES = (
  ...
  'sekh.middleware.KeywordsHighlightingMiddleware',
  )

This is it !

Search Engines

Currenty django-sekh supports these search engines :

  • Ask

  • Baidu

  • Bing

  • Google

  • Hotbot

  • Lycos

  • Yahoo

And even if you have a custom search engine plugged on your website, sekh can highlight the searched keywords. Currently sekh will highlight all the terms contained in this list of GET variables :

['highlight', 'hl', 'q', 'query', 'pattern']

You can change the supported values by defining a variable named HIGHLIGHT_GET_VARNAMES representing a list of supported variable names in your project’s settings.

Testing

If you want to test the highlighter, you can pass keywords in the hl parameter in GET.

http://localhost:8000/admin?hl=django%20admin

Metadata

Release files for django-sekh 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sekh 0.4
File Size Uploaded Provenance Actions
django-sekh-0.4.tar.gz 13.5 kB Without provenance Details for django-sekh-0.4.tar.gz

Release files / django-sekh-0.4.tar.gz

Download URL django-sekh-0.4.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0461d04da440cc539ffc1cc4fb23ab805b706040dd97a784d1bb9dcb2570ae17
BLAKE2b-256 checksum
How to use checksums
5d6374816e1d995398ceaf60a33270d51b9bedb73aa69b8fec56844adf342854
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-sekh 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page