You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -57,7 +64,19 @@ See the [Versioning](#versioning) section for details on how this project's vers
57
64
58
65
## Installation
59
66
60
-
Install the Django Language Server in your project's environment:
67
+
The Django Language Server can be installed using your preferred Python package manager.
68
+
69
+
For system-wide availability using either `uv` or `pipx`:
70
+
71
+
```bash
72
+
uv tool install django-language-server
73
+
74
+
# or
75
+
76
+
pipx install django-language-server
77
+
```
78
+
79
+
Or to try it out in your current project:
61
80
62
81
```bash
63
82
uv add --dev django-language-server
@@ -72,11 +91,9 @@ The package provides pre-built wheels with the Rust-based LSP server compiled fo
72
91
73
92
!!! note
74
93
75
-
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.
76
-
77
-
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.
94
+
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.
78
95
79
-
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.
96
+
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.
80
97
81
98
## Editor Setup
82
99
@@ -141,18 +158,24 @@ All feature requests should ideally start out as a discussion topic, to gather f
141
158
142
159
### Development
143
160
144
-
The project is written in Rust using PyO3 for Python integration:
161
+
The project is written in Rust using PyO3 for Python integration. Here is a high-level overview of the project and the various crates:
145
162
146
-
- LSP server implementation (`crates/djls/`)
147
-
- Template parsing and core functionality (`crates/djls-template-ast/`)
148
-
- Python integration via PyO3 for Django project introspection
163
+
- Main CLI interface ([`crates/djls/`](https://github.com/joshuadavidthomas/django-language-server/blob/main/crates/djls/))
164
+
- Django and Python project introspection ([`crates/djls-project/`](https://github.com/joshuadavidthomas/django-language-server/blob/main/crates/djls-project/))
165
+
- LSP server implementation ([`crates/djls-server/`](https://github.com/joshuadavidthomas/django-language-server/blob/main/crates/djls-server/))
Code contributions are welcome from developers of all backgrounds. Rust expertise is especially valuable for the LSP server and core components.
169
+
Code contributions are welcome from developers of all backgrounds. Rust expertise is valuable for the LSP server and core components, but 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.
151
170
152
-
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!
153
-
154
-
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.
171
+
So far it's all been built by a [a simple country CRUD web developer](https://youtu.be/7ij_1SQqbVo?si=hwwPyBjmaOGnvPPI&t=53) learning Rust along the way - send help!
155
172
156
173
## License
157
174
158
175
django-language-server is licensed under the Apache License, Version 2.0. See the [`LICENSE`](https://github.com/joshuadavidthomas/django-language-server/blob/main/LICENSE) file for more information.
176
+
177
+
---
178
+
179
+
django-language-server is not associated with the Django Software Foundation.
180
+
181
+
Django is a registered trademark of the Django Software Foundation.
0 commit comments