Django Google custom search engine app.
Project description
Django Google Search
Django Google custom search engine app.
Provides a simple tag rendering a Google Custom Search Engine input field and a view displaying search results.
Installation
Install or add django-googlesearch to your Python path.
Add googlesearch to your INSTALLED_APPS setting.
Add a GOOGLE_SEARCH_PARTNER_ID setting to your project’s settings.py file. This setting specifies the Google Custom Search Engine ID to use when rendering the Google search box, as provided by Google, i.e.:
GOOGLE_SEARCH_PARTNER_ID = 'partner-pub-329847239847234:xcvx-3kasd'
Add googlesearch url include to your project’s urls.py file:
(r'^search/', include('googlesearch.urls')),
Optionally add "django.core.context_processors.request", to your TEMPLATE_CONTEXT_PROCESSORS setting, i.e.:
TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.request", ...other processors... )
We need a request object when rendering the search input field and results to be able to display the search query value. This is optional and is not required for operation but is highly recommended.
Usage
Once installed you can add a Google search box to your templates by using the googlesearch_input template tag, i.e.:
{% load googlesearch_inclusion_tags %} ...some html... {% googlesearch_input %} ...some more html...
By default search results are displayed through the view with URL named googlesearch_results, as defined in googlesearch.urls. You can create your own URL named googlesearch_results and include the googlesearch_results template tag in its template to display results, i.e.:
{% load googlesearch_inclusion_tags %} ...some html... {% googlesearch_results %} ...some more html...
Changelog
0.0.5 (2011-08-11)
Refactor to not use django-preferences.
Documentation.
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
Built Distributions
Hashes for django-googlesearch-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f01255656dd7a9b67b3bcd66437ecb01ed6e9014f0e743032cba6cc39ba11d |
|
MD5 | b61a0d365312f04b94c10ed5b47e58ef |
|
BLAKE2b-256 | eb6c3c1e6642459439b606a3e43e627e33c9fe5713e9d30c33da2933984c14ab |
Hashes for django_googlesearch-0.0.5-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ae80167bdc49c044a3f376879d2a75da539acd8cfb15069ad7558da380c02f |
|
MD5 | 846629dd974a1f75fed4cd2c13b6a9f8 |
|
BLAKE2b-256 | def1b09e0d21d54e6d0aea2d397d30f74824a525d3b742385d40b331f6a7d258 |
Hashes for django_googlesearch-0.0.5-py2.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39b218cd4fb6943ef0772a2ce6e84c987fea26aefcebef40f5ce4c9bb748f515 |
|
MD5 | edf35719eab40c0c6f59bc26314ab639 |
|
BLAKE2b-256 | 1584009ab4ca5523dbdb6889f6b0705fdba6c30a5b68f5ea65a3cb4f538defeb |