No project description provided
Project description
Allows to easily index CMS pages and push them to algolia with multi-language support by default.
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'}}
Run python manage.py algolia_reindex_all_lang.
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 plan text from 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 import render_text_from_placeholder
class CustomModel(Model):
placeholder = PlaceholderField('Content')
def description(self) -> str:
return render_text_from_placeholder(self.placeholder)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file djangocms-algolia-1.3.0.0.macosx-10.15-x86_64.tar.gz.
File metadata
- Download URL: djangocms-algolia-1.3.0.0.macosx-10.15-x86_64.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f76105b161a88f849b359856abde8d372cd23309196955a3f47b24b851d2aca
|
|
| MD5 |
995973c29839a895dd67165242419636
|
|
| BLAKE2b-256 |
f3bac30a62660adfabd222990bcc1095181da0cbfd737161b8464116e66109aa
|