Skip to main content

Scolta AI Search for Django — zero-infrastructure AI search with Pagefind

Project description

scolta-django

Scolta AI Search for Django — zero-infrastructure AI-powered search with Pagefind. The Django adapter over the scolta Python binding.

Install & configure

# settings.py
INSTALLED_APPS = [..., "scolta_django"]

SCOLTA = {
    "ai_api_key": env("SCOLTA_API_KEY"),
    "ai_provider": "anthropic",
    "site_name": "My Site",
    "indexer": "auto",                 # pure-Python indexer (default)
    "models": ["blog.Post", "pages.Page"],   # models using SearchableMixin
    "output_dir": BASE_DIR / "static" / "scolta-pagefind",
    "state_dir": BASE_DIR / ".scolta-state",
    "auto_rebuild": True,              # debounced rebuild on model save/delete
    "auto_rebuild_delay": 300,
    "route_prefix": "api/scolta/v1",
}
# urls.py
urlpatterns = [..., path("", include("scolta_django.urls"))]

Make a model searchable:

from scolta_django.searchable import SearchableMixin

class Post(SearchableMixin, models.Model):
    title = models.CharField(max_length=200)
    body = models.TextField()
    # Override for HTML content / custom URLs:
    def to_searchable_content(self):
        from scolta.content import ContentItem
        return ContentItem(id=f"post-{self.pk}", title=self.title,
                           body_html=self.body, url=self.get_absolute_url(),
                           date=self.updated_at.strftime("%Y-%m-%d"))

Build the index and render the widget:

python manage.py scolta_build          # --force --incremental --resume --restart --sync
{% load scolta %}{% scolta_search %}

Wagtail

If Wagtail is installed, the optional scolta_django.wagtail module is loaded automatically (StreamField extraction, page-tree enumeration, admin panel).

Development

uv venv --python 3.12 && uv pip install -e ".[dev]"
uv run pytest

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

scolta_django-1.0.0.tar.gz (99.2 kB view details)

Uploaded Source

Built Distribution

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

scolta_django-1.0.0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file scolta_django-1.0.0.tar.gz.

File metadata

  • Download URL: scolta_django-1.0.0.tar.gz
  • Upload date:
  • Size: 99.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for scolta_django-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e26a363a110017d6250c67d77fe6926befea7a122ddeccd6549ee909bbb6fa4f
MD5 95a88b62cb7dc931ab13ef569f805a23
BLAKE2b-256 cb98c5d059b6201cb33d8709356abbce7ad4a837acf38c04b62b27563482e7ff

See more details on using hashes here.

File details

Details for the file scolta_django-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: scolta_django-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for scolta_django-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b219813cb83491a6285eb88d82d5f1a871ded675cf53f009292fb6a1862416b7
MD5 2cc3c88f2ef913cc4f6242e872eef491
BLAKE2b-256 a656082e5fef65fff5b542579fbaa65dcf09d54145d1d59e7a2c2d2629c01a33

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