Allows to easily index CMS pages and push them to algolia.
Usage
Install as pip install djangocms-algolia.
Add the following variables to settings.py:
INSTALLED_APPS = [
'djangocms_algolia',
'algoliasearch_django',
]
ALGOLIA = {
'APPLICATION_ID': env.get('ALGOLIA_APPLICATION_ID', ''),
'API_KEY': env.get('ALGOLIA_API_KEY', '')
}
# not used, but django-haystack requires it to be preset in settings.py
HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.simple_backend.SimpleEngine'}}
You can exclude plugins from indexing by adding them to settings.ALDRYN_SEARCH_EXCLUDED_PLUGINS.
You can also limit the CMS pages content using settings.ALGOLIA_SEARCH_INDEX_TEXT_LIMIT.
Render plain text from CMS placeholders
This package also includes a function that helps to index django models which utilize PlaceholderField.
You can use it as following:
from djangocms_algolia.utils.render import render_text_from_placeholder
class CustomModel(Model):
placeholder = PlaceholderField('Content')
def description(self) -> str:
return render_text_from_placeholder(self.placeholder)
Metadata
Release files for djangocms-algolia 1.5.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djangocms-algolia-1.5.0.1.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djangocms_algolia-1.5.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / djangocms-algolia-1.5.0.1.tar.gz
| Download URL | djangocms-algolia-1.5.0.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e064dcbcdd5ecfcdfdec9d2ef3e7bfa3b7c1735dd71b1dcef1cfb5950ddaddcf
|
|
BLAKE2b-256 checksum How to use checksums |
b42157090e213301d3e5562e0e8b9a4cb9a21a8dc08c2b31588d8a6e98c863b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.8
|
Release files / djangocms_algolia-1.5.0.1-py3-none-any.whl
| Download URL | djangocms_algolia-1.5.0.1-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8921cc0eb39d10593f4f333d8a6680b5f7fc0e79bcce91344bd7c5dcb70385fa
|
|
BLAKE2b-256 checksum How to use checksums |
55d0c0378825b572194d98f2870df46ae8b64d01296edc7edefa3050dd89d198
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.8
|