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 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
Built Distribution
Close
Hashes for djangocms-algolia-1.4.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12412c18fc5aa067c031feda14919a764d216dbc4c89498d077d149ee8c7f0c5 |
|
MD5 | 84ba60d7072f930c92fc8b6982f4d269 |
|
BLAKE2b-256 | 1bf9779211dbd12cd61a414ede5bb3be3b438077dc467b268d173792723a60bd |
Close
Hashes for djangocms_algolia-1.4.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 620fc7d9a16892265b12affb75e1260f369ab128d292b24593e45bd7f378aae8 |
|
MD5 | 70caf8c0a78c620f068461cd5c0af2ad |
|
BLAKE2b-256 | 00091798b9c1792d35ea6ef6787a81ad94058b43cec2625f4c24aa0c2d3e3222 |