Skip to main content

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
{% load scolta %}{% scolta_search %}

Static assets

The browser runtime (scolta.js/css, the WASM scoring engine, the Pagefind runtime) is vendored inside the scolta package, where no default staticfiles finder looks. Add the bundled finder so collectstatic (and the dev server) serve it at the default asset_url (/static/scolta/):

STATICFILES_FINDERS = [
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
    "scolta_django.staticfiles.ScoltaAssetFinder",
]

Settings:

  • SCOLTA["asset_url"] (default /static/scolta/) — base URL the {% scolta_search %} tag uses for the CSS/JS/WASM tags. Point it elsewhere if you serve the bundle from a CDN or copy it yourself.
  • SCOLTA["amazee_access"] (optional) — callable (request) -> bool gating the Amazee.ai settings page and JSON endpoints. Default: active staff user.

Health endpoint

GET /api/scolta/v1/health always answers monitoring tools: anonymous requests get {"status": "ok"} (or "degraded"), HTTP 200. The full diagnostic payload (AI provider, configured flags, index state) requires an active staff user — the same bar as staff_member_required, without the login redirect that would break uptime monitors.

Wagtail

If Wagtail is installed, the optional scolta_django.wagtail module is loaded automatically (StreamField extraction, page-tree enumeration, admin panel). Indexing Wagtail pages is opt-in: set SCOLTA["wagtail"] = True to use the Wagtail content source, which indexes live public pages alongside the configured models. With the flag unset, only SCOLTA["models"] are indexed (the admin panel and signal wiring load either way).

Development

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

Metadata

Release files for scolta-django 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scolta-django 1.0.1
File Size Uploaded Provenance
scolta_django-1.0.1.tar.gz 122.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scolta-django 1.0.1
File Interpreter ABI Platform
scolta_django-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 156.1 kB

Release files / scolta_django-1.0.1.tar.gz

Download URL scolta_django-1.0.1.tar.gz
Size 122.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aaf04720ffa162aab756ccc3646a774296ab607b016604ba7ae364a551ecb1e1
BLAKE2b-256 checksum
How to use checksums
fe7187321c0011e49001f53ccb238eef13d300e7e5f178725e793aa4ab6947be
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / scolta_django-1.0.1-py3-none-any.whl

Download URL scolta_django-1.0.1-py3-none-any.whl
Size 33.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aba8e58cac2dc4bba53384b4a5fa2d7e72b08613303a2e8584824758e680cb65
BLAKE2b-256 checksum
How to use checksums
3c0deb143b9ea36657932ddbed1bc9d5febe75af6b0e0b74c1307f7a332d6dbf
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for scolta-django 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page