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.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba25c36c7e76f59067c5bef8d50186faa3ce2a105b4df49df8a5a54740aec37 |
|
MD5 | 8375add1cf34abdd7bbd6efa569358f1 |
|
BLAKE2b-256 | a09c9eeedf304e77de0601f5f818e3b452737d76510bd74b2d6bbc60f6128aec |
Close
Hashes for djangocms_algolia-1.3.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2192dc9f3bef81650a7ba7f3598714b95159b6ec9bf4ca4b47e11ee45be98be9 |
|
MD5 | 7b3c115b90893c030344c6d106c39b25 |
|
BLAKE2b-256 | 20a812fe1bc226099f7050adbfc9aecf209433fcdb5e8a35135b1618dd245e2b |