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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5610869253ad3caf12d8a6be15e62b8a9ddae29e0c3a6d21e46e27d19f06a376 |
|
MD5 | f2f95423997205757399484d8f2631aa |
|
BLAKE2b-256 | 3d9775482cdadb6616bc29132fe8a958c2535563fab50fb3f137de7fb14bf7d4 |
Close
Hashes for djangocms_algolia-1.3.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f38c1829890e3ce7e9ea6489fa1484876710dccccfca4130cc2176ee5e04eba8 |
|
MD5 | 14bce791a7acda3f7f92ae5958b5e343 |
|
BLAKE2b-256 | 5acb71af2837121b7d8755b5b3185bcd5b6c235af5d6c4f995d28057867c0a2c |