Django Generic Search
Django Generic Search is a Django app to conduct generic search on your site’s pages. Visitors on your site can search for any available pages on your side given they new or can guess accurately keywords or search queries related to thos pages.
The app uses the page title and meta name and meta description html tags to generate search results so be sure to include this tags in your html page templates.
The application is currently not optimized for sites that result in large amounts of data upon crawling.
For a better experience, this app can be used together with django-robots and the django sitemaps framework.
Quick start
Install the package using pip.
$ pip install django-generic-search
Add generic-search to your INSTALLED_APPS setting like this
INSTALLED_APPS = [
...
'generic-search',
]
Include the generic-search URLconf in your project urls.py like this
path('search/', include('generic-search.urls')),
Create a html form and point its action attribute to the above url as below
<form method="GET" action="{% url 'search:general_search' %}">
<input type="text" name="q" placeholder="Search...">
<button type="submit" class="btn btn-outline-primary custom-inline-button">Go</button>
</form>
include settings below in project settings.py
ALLOWED_HOSTS = [
'localhost',
]
SPYDER_START_URLS = {
'gammaspider': ['https://localhost:8000/']
}
When in production, update the settings above appropriately to reflect your production environment.
Override the default template used to display the search index and search results page to reflect the theme of your site by creating a templates directory in your project root directory. In the created templates directory, create a directory with the name generic_search and place index.html in it. You can copy the template provided in the package to the path created above to get a full picture of the available blocks that can be overriden.
Start the development server and visit http://127.0.0.1:8000/
On a new terminal, run the commands below.
Run python manage.py crawlsite to generate data about available pages on your site. Run python manage.py cleancrawlresults to prepare the data for indexing. Run python manage.py indexsite to generate an index file for the data.
Visit http://127.0.0.1:8000/<url as apecified in your url conf>/?q=<search-query> to search.
Metadata
Release files for django-generic-search 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-generic-search-2.1.0.tar.gz | 1.4 MB | Without provenance | Details for django-generic-search-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_generic_search-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for django_generic_search-2.1.0-py3-none-any.whl |
Total release size: 2.9 MB
Release files / django-generic-search-2.1.0.tar.gz
| Download URL | django-generic-search-2.1.0.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00fcecfea698de110e9e690e499777b3422d1371a06be3445c646194fbd0640e
|
|
BLAKE2b-256 checksum How to use checksums |
79da7ca708401ca57ce12926813ac3e0a75d9040ea74b0cc2a5166c3d3208557
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Release files / django_generic_search-2.1.0-py3-none-any.whl
| Download URL | django_generic_search-2.1.0-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c475d08e71e373f85716951ba4b8c9256ba55541782a8f83dbf169277c4d2df
|
|
BLAKE2b-256 checksum How to use checksums |
2c43fcc64a8976fba3543b7fa7e5cf8ecc987a7e663426280ce162faeaade128
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Security for django-generic-search 2.1.0
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.