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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb2b01c3dc2599fce368ddd666bf8b20ca8ef1fae321dae2b43ef4426d4d02ce |
|
MD5 | 4d516ba1ce7b2df708f8495be20d8a1a |
|
BLAKE2b-256 | a67da9e26a0136abe74de1b5c1ea324c6daac3d781c578d18cdf35c303ef2568 |
Close
Hashes for djangocms_algolia-1.4.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ff375030f404e5dadf15f50978ccea51c0b2f4795d52cfc00fced59072975b |
|
MD5 | 3c23b3b1d0126165b837958a83100a22 |
|
BLAKE2b-256 | 66266ab4fb4102fb437bba79c74e5d7c044df321fdbd4270d658135f22393f26 |