Skip to main content

DjangoQL

Tests PyPI Python Version Django Version License

Advanced search language for Django, with auto-completion. Supports logical operators, parenthesis, table joins, and works with any Django model. Tested on Python 3.10–3.14, Django 5.2 and 6.0. The auto-completion feature has been tested in Chrome, Firefox, Safari, IE9+.

This is a community fork. djangoql-iplweb is a fork of the original DjangoQL by ivelum — install the upstream package from djangoql on PyPI. This fork adds internationalization (i18n) of error messages and modernized packaging/tooling.

These changes are offered back to the upstream project. If the original maintainers merge them, please switch back to the upstream djangoql package — this fork exists only to make the improvements available in the meantime, and will defer to upstream once they land there.

It is published on PyPI as djangoql-iplweb, but the import name stays djangoql (so INSTALLED_APPS and import djangoql are unchanged).

See a video: DjangoQL demo

DjangoQL auto-completion example

Features

  • Python-like query syntax: logical operators (and, or), parenthesis, and the full set of comparison operators
  • Searches across model relations via joins, e.g. author.last_name = "Tolstoy"
  • Works with any Django model and drops into the Django admin with a single mixin
  • Live auto-completion of model field names and values in the admin
  • Configurable schema to restrict searchable models/fields (including declarative per-model include_fields/exclude_fields allowlists and denylists) and provide suggestion options
  • Custom search fields for annotations and fully custom search logic
  • Internationalized error messages with translation catalogs for 11 locales
  • Usable outside the Django admin, including a standalone JavaScript completion widget
  • Multi-line queriesShift+Enter inserts a newline (Enter still submits)
  • Pretty-print / formatting — re-indent a query via format_query() or the …/format/ endpoint
  • Per-branch record counts — see how many rows each sub-expression matches via explain() or the …/explain/ endpoint
  • Syntax highlighting — a tokenizer (DjangoQLHighlight.tokenize) plus a lightweight, restyleable overlay; no palette or editor imposed
  • Describe a schema for an LLMdescribe_schema_for_llm() (and the djangoql_describe_schema_for_llm command) emit the full search space as JSON or compact text, ready to teach a model to generate valid DjangoQL

Installation

Using uv (recommended):

$ uv add djangoql-iplweb

Using pip:

$ pip install djangoql-iplweb

Add 'djangoql' to INSTALLED_APPS in your settings.py:

INSTALLED_APPS = [
    ...
    'djangoql',
    ...
]

For full setup instructions and usage examples, see the Documentation below.

Documentation

📖 Full documentation: https://iplweb.github.io/djangoql-iplweb/

The site is built with MkDocs from the docs/ directory. Key pages:

Example project

A runnable demo of all the features above (on a richly related dataset) lives in example_project/. See its README for details. Quick start:

cd example_project
uv run python manage.py migrate
uv run python manage.py seed_demo          # lots of related demo data
uv run python manage.py createsuperuser    # optional, for the admin
uv run python manage.py runserver

Then open http://127.0.0.1:8000/ (search demo — auto-completion, multi-line, highlighting, Format, Explain counts) or http://127.0.0.1:8000/admin/ (admin with completion + multi-line + the highlight overlay).

What it looks like

Running a query — live syntax highlighting and results:

Search demo

The Format button re-indents a query (syntax highlighting throughout):

Formatted query

Explain counts breaks an empty result down per sub-expression, so you can see where the data runs out — here each side matches ~500 rows but their and matches none:

Per-branch counts for an empty result

Syntax errors are pinpointed in the query box:

Syntax error highlighted

Supported by

This fork is graciously supported and maintained by iplweb.

iplweb

License

MIT

Download files

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

Source Distribution

djangoql_iplweb-0.31.1.tar.gz (318.1 kB view details)

Uploaded Source

Built Distribution

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

djangoql_iplweb-0.31.1-py3-none-any.whl (377.3 kB view details)

Uploaded Python 3

File details

Details for the file djangoql_iplweb-0.31.1.tar.gz.

File metadata

  • Download URL: djangoql_iplweb-0.31.1.tar.gz
  • Upload date:
  • Size: 318.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","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 djangoql_iplweb-0.31.1.tar.gz
Algorithm Hash digest
SHA256 722b922ce2a1b209e4253c29bd4c618179b4d7fe76bb4c444c7e230384845421
MD5 dfd1e63a24cf0935bfe421e62fd6e6da
BLAKE2b-256 6f671143e2369e8cd09fab96356fc6ab998fc3c3b7561916b0642355bbf0cc7d

See more details on using hashes here.

File details

Details for the file djangoql_iplweb-0.31.1-py3-none-any.whl.

File metadata

  • Download URL: djangoql_iplweb-0.31.1-py3-none-any.whl
  • Upload date:
  • Size: 377.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","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 djangoql_iplweb-0.31.1-py3-none-any.whl
Algorithm Hash digest
SHA256 030ec5b299629e95d0ffe275c92f06e8bfb7bc36758ed6745c5135ec119d0e9c
MD5 317d8343ad666e404150be8f222d0acf
BLAKE2b-256 7f0789288aae90bed7b801fe5b47f5d9b79645db62e2b1012e095a7d6b6c046b

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