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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5abc46c249235175e89577428bd925a61b3df37f4b09c80b33f086f7aa9ab01a |
|
MD5 | 4be66f27646936a56e9fe5b43473cf4a |
|
BLAKE2b-256 | f603fa7db9a09a98bf55439f3194297f022b100656791507a20ffe75c4931092 |
Close
Hashes for djangocms_algolia-1.3.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4d7d8e3d1b778e5db2994137379236b6afba28b2689451c41bc5bd5b9a8f0ec |
|
MD5 | cdd0fa8279c0c6b766f9623fe788b756 |
|
BLAKE2b-256 | 0365d46bcd1ff0193329f8fd3c036021b2b20b896e629309aab26e6f92b6118d |