fourdigits / django-template-lsp

GNU General Public License v3.0
27 stars 0 forks source link

Could not collect Django data #64

Open thibaudcolas opened 6 days ago

thibaudcolas commented 6 days ago

I can’t get any completions / the language server to work because it fails to retrieve local project data. Here are the relevant logs, where bakerydemo is the root of the Django project:

Collection django data from local python path: bakerydemo/venv/bin/python
Collector command: bakerydemo/venv/bin/python pipx/venvs/django-template-lsp/lib/python3.12/site-packages/djlsp/scripts/django-collector.py --project-src=bakerydemo
Command '['bakerydemo/venv/bin/python', 'pipx/venvs/django-template-lsp/lib/python3.12/site-packages/djlsp/scripts/django-collector.py', '--project-src=bakerydemo']' returned non-zero exit status 1.
Could not collect Django data

It’s hard to tell what exactly the error might be when executing that command within the VS Code context. Trying to run django-collector.py manually, I’ve had some success, but have no idea why it might be failing within the extension.

The output I get when it succeeds starts with:

could not find class definition
could not find class definition
could not find class definition
could not find class definition
Failed to parse library (base): 'base'
rubenhesselink commented 1 day ago

Thank you for submitting this issue, we are currently looking into this problem.

krukas commented 1 day ago

@thibaudcolas I cloned bakerydemo and datacollect works for me when manually set the Django settings (the have a different manage.py file to what Django creates and auto detect doesn't work).

What do you have configured in VScode and did you make changes to the project?