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.3.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd30dd4e389e0a3a39a560361b18b94d9f279ceba00e2358178c122bb1925739 |
|
MD5 | b3069e58b8d3b940a4d454201ca2f6f3 |
|
BLAKE2b-256 | 23092d8b17c98250e1687ad8bc68035980b68135188fe82c4b5f108e1894bd4a |
Close
Hashes for djangocms_algolia-1.3.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8656d144f33dac3ca2bedbb3cf14a989662f751396a4aa95911b73c1a131d339 |
|
MD5 | 8bac23c9d60524d428c16829b064b314 |
|
BLAKE2b-256 | 51af5d9550b99a623053a14b503b90b6870a1cc9f09ab6e94c24a59cc4fe2f57 |