No project description provided
Project description
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)
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
Built Distribution
Close
Hashes for djangocms-algolia-1.5.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e054fb15bdf799a74fb59f2c219a365725859f7aa1a5e9882268dc3d54787ea7 |
|
MD5 | f24e8366662f0e008d35b458a9722f8d |
|
BLAKE2b-256 | e3667e876afe8044e6af8d13d5a23ef77d0903906e0224f2a18b998b0ea1ee58 |
Close
Hashes for djangocms_algolia-1.5.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca41827fce0f4b8eab9c427e1ad7f014c5ff9a807a84449eeafcc829ed568803 |
|
MD5 | e74841ceb3f0c3e967204e66eb296fab |
|
BLAKE2b-256 | e6bf30fd1ab2a3a891b5e68a77b7c869bcc3811a4aae5ab61f80ab67f4dfa6f4 |