Skip to content
Highlight the keywords of a page if a visitor is coming from a search engine.
Python Makefile
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



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.


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

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

$ pip install -e git://


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


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.


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

Something went wrong with that request. Please try again.