Skip to content

Commit 492f2f6

Browse files
adjust README for new architecture
1 parent 074d449 commit 492f2f6

File tree

1 file changed

+20
-55
lines changed

1 file changed

+20
-55
lines changed

README.md

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ A language server for the Django web framework.
1414
However, the foundation has been laid:
1515

1616
- [x] Working server architecture
17-
- [x] Server implementing the Language Server Protocol written in Rust
18-
- [x] Python agent running as a persistent process within the Django project's virtualenv
19-
- [x] Server-agent communication via Protocol Buffers
17+
- [x] Language Server Protocol implementation in Rust
18+
- [x] Direct Django project interaction through PyO3
19+
- [x] Single binary distribution with Python packaging
2020
- [x] Custom template parser to support LSP features
2121
- [x] Basic HTML parsing, including style and script tags
2222
- [x] Django variables and filters
@@ -37,61 +37,25 @@ See the [Versioning](#versioning) section for details on how this project's vers
3737

3838
## Installation
3939

40-
The Django Language Server consists of two main components:
41-
42-
- **An LSP server**: Rust binary `djls`, distributed through the Python package `djls-server`
43-
- **A Python agent**: `djls-agent` package that runs in your Django project
44-
45-
Both will need to be available in your Django project in order to function.
46-
47-
The quickest way to get started is to install both the server and agent in your project's environment:
40+
Install the Django Language Server in your project's environment:
4841

4942
```bash
50-
uv add --dev 'djls[server]'
43+
uv add --dev django-language-server
5144
uv sync
5245

5346
# or
5447

55-
pip install djls[server]
48+
pip install django-language-server
5649
```
5750

58-
> [!NOTE]
59-
> The server should be installed globally on your development machine. The quick-start method above will install the server in each project's environment and is only intended for trying things out. See the [Server](#server) section below for details.
60-
61-
### Server
62-
63-
You can install the pre-built binary package from PyPI, or build from source using cargo.
51+
The package provides pre-built wheels with the Rust-based LSP server compiled for common platforms. Installing it adds the `djls` command-line tool to your environment.
6452

65-
The server binary is published to PyPI as `djls-server` for easy installation via uv or pipx:
66-
67-
```bash
68-
uv tool install djls-server
69-
70-
# or
71-
72-
pipx install djls-server
73-
```
74-
75-
If you have a Rust toolchain available and prefer to build from source, you can install via cargo:
76-
77-
```bash
78-
cargo install --git https://github.com/joshuadavidthomas/django-language-server
79-
```
80-
81-
### Agent
82-
83-
The agent needs to be installed in your Django project's environment to provide project introspection.
84-
85-
The agent is published to PyPI as `djls-agent` and should be added to your project's development dependencies:
86-
87-
```bash
88-
uv add --dev djls-agent
89-
uv sync
90-
91-
# or
92-
93-
pip install djls-agent
94-
```
53+
> [!NOTE]
54+
> The server must currently be installed in each project's environment as it needs to run using the project's Python interpreter to access the correct Django installation and other dependencies.
55+
>
56+
> Global installation is not yet supported as it would run against a global Python environment rather than your project's virtualenv. The server uses [PyO3](https://pyo3.rs) to interact with Django, and we aim to support global installation in the future, allowing the server to detect and use project virtualenvs, but this is a tricky problem involving PyO3 and Python interpreter management.
57+
>
58+
> If you have experience with [PyO3](https://pyo3.rs) or [maturin](https://maturin.rs) and ideas on how to achieve this, please check the [Contributing](#contributing) section below.
9559
9660
## Editor Setup
9761

@@ -109,8 +73,6 @@ This project adheres to DjangoVer. For a quick overview of what DjangoVer is, he
10973
11074
In short, `v5.1.x` means the latest version of Django the Django Language Server would support is 5.1 — so, e.g., versions `v5.1.0`, `v5.1.1`, `v5.1.2`, etc. should all work with Django 5.1.
11175

112-
At this moment, all components of the Django Language Server (the `djls` binary, the `djls-agent` agent package on PyPI, and the `djls-binary` binary distribution package on PyPI) will share the same version number. When a new version is released, all packages are updated together regardless of which component triggered the release.
113-
11476
### Breaking Changes
11577

11678
While DjangoVer doesn't encode API stability in the version number, this project strives to follow Django's standard practice of "deprecate for two releases, then remove" policy for breaking changes. Given this is a language server, breaking changes should primarily affect:
@@ -148,14 +110,17 @@ All feature requests should ideally start out as a discussion topic, to gather f
148110

149111
### Development
150112

151-
The project consists of both Rust and Python components:
113+
The project is written in Rust using PyO3 for Python integration:
152114

153-
- Rust: LSP server, template parsing, and core functionality (`crates/`)
154-
- Python: Django project and environment introspection agent (`packages/`)
115+
- LSP server implementation (`crates/djls/`)
116+
- Template parsing and core functionality (`crates/djls-template-ast/`)
117+
- Python integration via PyO3 for Django project introspection
155118

156119
Code contributions are welcome from developers of all backgrounds. Rust expertise is especially valuable for the LSP server and core components.
157120

158-
Python and Django developers should not be deterred by the Rust codebase - Django expertise is just as valuable. The Rust components were built by [a simple country CRUD web developer](https://youtu.be/7ij_1SQqbVo?si=hwwPyBjmaOGnvPPI&t=53) learning Rust along the way.
121+
One significant challenge we're trying to solve is supporting global installation of the language server while still allowing it to detect and use project virtualenvs for Django introspection. Currently, the server must be installed in each project's virtualenv to access the project's Django installation. If you have experience with PyO3 and ideas about how to achieve this, we'd love your help!
122+
123+
Python and Django developers should not be deterred by the Rust codebase - Django expertise is just as valuable. Understanding Django's internals and common development patterns helps inform what features would be most valuable. The Rust components were built by [a simple country CRUD web developer](https://youtu.be/7ij_1SQqbVo?si=hwwPyBjmaOGnvPPI&t=53) learning Rust along the way.
159124

160125
## License
161126

0 commit comments

Comments
 (0)