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-lsp

Usage

Running the Server

django-lsp-server

Neovim Setup

  1. Install via Mason:

    :MasonInstall django-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.3.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.3-py3-none-any.whl (52.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_qs_lsp-1.4.3.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.3.tar.gz
Algorithm Hash digest
SHA256 0f7de9af34e845c4fe6f6a923e10aa25c77a30ce2a3656f142aff334becc018b
MD5 003280862c9b569539444e64cfe85648
BLAKE2b-256 08f9c0c3d17e0929a07e1b9c11b0f4852e526975bcaf4e7e36faf457ff56bb24

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_qs_lsp-1.4.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: django_qs_lsp-1.4.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b2d2a59798900067223595fa4c6e56e291c2484b174a3d686a99d6dfe9004fdb
MD5 0c529ba35ad43b18db91fe22bf17820a
BLAKE2b-256 dd7b2f8aba00d3581f288399f0798f72cbf2f1646a108eb2e2f527763f08786d

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_qs_lsp-1.4.3-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