Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangocms-algolia-1.3.3.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djangocms_algolia-1.3.3.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file djangocms-algolia-1.3.3.0.tar.gz.

File metadata

  • Download URL: djangocms-algolia-1.3.3.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.10

File hashes

Hashes for djangocms-algolia-1.3.3.0.tar.gz
Algorithm Hash digest
SHA256 488172de1f42166059c3518aee3a6d86f95ef97a2f5c119fb94ec068d0ab9fe1
MD5 4388712271d9e0f280eb9b6ace1f3dda
BLAKE2b-256 4f6e0d7c07961ea2b938cebb96d2e4cb468b0a3c6c9438c93e272e1317e4a3ef

See more details on using hashes here.

File details

Details for the file djangocms_algolia-1.3.3.0-py3-none-any.whl.

File metadata

  • Download URL: djangocms_algolia-1.3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.10

File hashes

Hashes for djangocms_algolia-1.3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 387da3c0f5472e4e15d285e307b5100339755e7e0140725392f9dd963f4e1273
MD5 b8ce2cc8c590fc223d73197a49ccdc6c
BLAKE2b-256 5f971723ee30018241d46da620638c489eafb8901510e1b9615dd2518d840406

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page