Skip to content

Commit fb0b596

Browse files
Update installation instructions (#348)
1 parent cf60dd6 commit fb0b596

File tree

1 file changed

+74
-13
lines changed

1 file changed

+74
-13
lines changed

README.md

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,96 @@ See the [Versioning](#versioning) section for details on how this project's vers
7171

7272
## Installation
7373

74-
The Django Language Server can be installed using your preferred Python package manager.
74+
The Django Language Server can be installed using your preferred Python package manager or as a standalone binary.
7575

76-
For system-wide availability using either `uv` or `pipx`:
76+
To try the language server without installing using [`uvx`](https://docs.astral.sh/uv/guides/tools/#running-tools):
7777

7878
```bash
79-
uv tool install django-language-server
79+
uvx --from django-language-server djls serve
80+
```
81+
82+
> [!NOTE]
83+
> The server will automatically detect and use your project's Python environment when you open a Django project. It needs access to your project's Django installation and other dependencies, but should be able to find these regardless of where the server itself is installed.
84+
85+
### Install with a package manager (recommended)
86+
87+
The language server is published to PyPI with pre-built wheels for the following platforms:
88+
89+
- **Linux**: x86_64, aarch64 (both glibc and musl)
90+
- **macOS**: x86_64, aarch64
91+
- **Windows**: x64
92+
- **Source distribution**: Available for other platforms
93+
94+
Installing it adds the `djls` command-line tool to your environment.
95+
96+
#### System-wide tool installation
8097

81-
# or
98+
Install it globally in an isolated environment using `uv` or `pipx`:
8299

100+
```bash
101+
# Using uv
102+
uv tool install django-language-server
103+
104+
# Or using pipx
83105
pipx install django-language-server
84106
```
85107

86-
Or to try it out in your current project:
108+
#### Install with pip
109+
110+
Install from PyPI using pip:
111+
112+
```bash
113+
pip install django-language-server
114+
```
115+
116+
Or add as a development dependency with uv:
87117

88118
```bash
89119
uv add --dev django-language-server
90-
uv sync
120+
```
91121

92-
# or
122+
### Standalone binaries
93123

94-
pip install django-language-server
124+
Standalone binaries are available for macOS, Linux, and Windows from [GitHub Releases](https://github.com/joshuadavidthomas/django-language-server/releases).
125+
126+
#### Linux and macOS
127+
128+
```bash
129+
# Download the latest release for your platform
130+
# Example for Linux x64:
131+
curl -LO https://github.com/joshuadavidthomas/django-language-server/releases/latest/download/django-language-server-VERSION-linux-x64.tar.gz
132+
133+
# Extract the archive
134+
tar -xzf django-language-server-VERSION-linux-x64.tar.gz
135+
136+
# Move the binary to a location in your PATH
137+
sudo mv django-language-server-VERSION-linux-x64/djls /usr/local/bin/
95138
```
96139

97-
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.
140+
#### Windows
98141

99-
> [!NOTE]
100-
> The server will automatically detect and use your project's Python environment when you open a Django project. It needs access to your project's Django installation and other dependencies, but should be able to find these regardless of where the server itself is installed.
101-
>
102-
> It's recommended to use `uv` or `pipx` to install it system-wide for convenience, but installing in your project's environment will work just as well to give it a test drive around the block.
142+
```powershell
143+
# Download the latest release for your platform
144+
# Example for Windows x64:
145+
Invoke-WebRequest -Uri "https://github.com/joshuadavidthomas/django-language-server/releases/latest/download/django-language-server-VERSION-windows-x64.zip" -OutFile "django-language-server-VERSION-windows-x64.zip"
146+
147+
# Extract the archive
148+
Expand-Archive -Path "django-language-server-VERSION-windows-x64.zip" -DestinationPath .
149+
150+
# Move the binary to a location in your PATH (requires admin)
151+
# Or add the directory containing djls.exe to your PATH
152+
Move-Item -Path "django-language-server-VERSION-windows-x64\djls.exe" -Destination "$env:LOCALAPPDATA\Programs\djls.exe"
153+
```
154+
155+
### Install from source with cargo
156+
157+
Build and install directly from source using Rust's cargo:
158+
159+
```bash
160+
cargo install --git https://github.com/joshuadavidthomas/django-language-server djls --locked
161+
```
162+
163+
This requires a Rust toolchain (see [rust-toolchain.toml](rust-toolchain.toml) for the required version) and will compile the language server from source.
103164

104165
## Editor Setup
105166

0 commit comments

Comments
 (0)