Skip to main content

Language Server Protocol implementation for Django ORM operations

Project description

Django ORM Language Server Protocol (LSP)

CI

A Language Server Protocol implementation for Django ORM that provides intelligent autocompletion for model queries, field lookups, and related field navigation.

Features

  • Smart Completions: Field lookups (__exact, __contains, __startswith) and related field navigation (user__profile__bio)
  • Context-Aware: Only shows completions for imported models
  • Multi-App Support: Works with Django projects that have multiple apps
  • Django Integration: Uses Django's built-in field lookup APIs

Installation

pip install django-qs-lsp

Usage

Running the Server

django-qs-lsp-server

Neovim Setup

  1. Install via Mason:

    :MasonInstall django-qs-lsp
    
  2. Configure LSPConfig:

    require("lspconfig").django_lsp.setup({
      filetypes = { "python" },
      root_dir = require("lspconfig.util").root_pattern("manage.py"),
    })
    

Supported Contexts

The LSP provides completions for:

  • Model.objects.filter(...)
  • Model.objects.exclude(...)
  • Model.objects.get(...)
  • Model.objects.annotate(...)
  • Model.objects.order_by(...)

Example

from django.contrib.auth.models import User

# Field completions
User.objects.filter(username=  # Suggests: username=
User.objects.filter(email__   # Suggests: email__exact, email__contains, etc.

# Related field completions
User.objects.filter(profile__  # Suggests: profile__bio, profile__user, etc.

Configuration

# Context-aware completions (default: true)
export DJANGO_LSP_CONTEXT_AWARE=true

# Debug logging
export DJANGO_LSP_DEBUG=true

Development

# Install dependencies
pip install -e ".[dev]"

# Run tests
python -m pytest tests/ -v

# Code quality
ruff check .
mypy src/django_lsp/

License

MIT License# Test release trigger

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

django_qs_lsp-1.4.4.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

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

django_qs_lsp-1.4.4-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

Details for the file django_qs_lsp-1.4.4.tar.gz.

File metadata

  • Download URL: django_qs_lsp-1.4.4.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_qs_lsp-1.4.4.tar.gz
Algorithm Hash digest
SHA256 aef6e661fd22b9abbc17ce993da19d4aceec8a710506d30922f60ea099479882
MD5 1f707b9357072296737531355d036081
BLAKE2b-256 5cf5dcb7179111b26a7d8a5ce338da722717d5b7817214f13701aafe5f73dd44

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_qs_lsp-1.4.4.tar.gz:

Publisher: publish.yml on JBSK8NC/django-lsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_qs_lsp-1.4.4-py3-none-any.whl.

File metadata

  • Download URL: django_qs_lsp-1.4.4-py3-none-any.whl
  • Upload date:
  • Size: 52.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_qs_lsp-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c5f1bb08f4225656869a049e9e4cfcbfaa6b9a296bc8940dbcba4ae13822c95
MD5 fe654345b51c4461080ad4662b90c55a
BLAKE2b-256 b7dba7165ea83989767c64bb34ad1d4eed88ce71f4f6728f8c210cb2ff2d3ae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_qs_lsp-1.4.4-py3-none-any.whl:

Publisher: publish.yml on JBSK8NC/django-lsp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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