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
Copy file name to clipboardExpand all lines: docs/configuration.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,19 @@ The server needs access to your virtual environment to discover installed Django
36
36
- Your virtual environment is in a non-standard location
37
37
- Auto-detection fails for your setup
38
38
39
+
### `pythonpath`
40
+
41
+
**Default:**`[]` (empty list)
42
+
43
+
Additional directories to add to Python's import search path when the inspector process runs. These paths are added to `PYTHONPATH` alongside the project root and any existing `PYTHONPATH` environment variable.
44
+
45
+
**When to configure:**
46
+
47
+
- Your project has a non-standard structure where Django code imports from directories outside the project root
48
+
- You're working in a monorepo where Django imports shared packages from other directories
49
+
- Your project depends on internal libraries in non-standard locations
50
+
- You need to make additional packages importable for Django introspection
51
+
39
52
### `debug`
40
53
41
54
**Default:**`false`
@@ -66,7 +79,8 @@ Pass configuration through your editor's LSP client using `initializationOptions
66
79
```json
67
80
{
68
81
"django_settings_module": "myproject.settings",
69
-
"venv_path": "/path/to/venv"
82
+
"venv_path": "/path/to/venv",
83
+
"pythonpath": ["/path/to/shared/libs"]
70
84
}
71
85
```
72
86
@@ -82,6 +96,7 @@ If you use `pyproject.toml`, add a `[tool.djls]` section:
82
96
[tool.djls]
83
97
django_settings_module = "myproject.settings"
84
98
venv_path = "/path/to/venv"# Optional: only if auto-detection fails
0 commit comments