Reputation: 565
hello everyone I am having a problem the visual studio code autocomplete for django does not work for me, because for python it does it without problems but when working with django the framework options do not work, that is when I work with views based on classes does not generate the autocomplete, such as template_name, form_class, etc ..., likewise with the models it does not generate the help of max_length, and those other things of the framework, I have selected the interpreter but it does not work for me and also python: build workspace symbols and nothing. in advance I appreciate the help.
Upvotes: 10
Views: 18010
Reputation: 7103
install some of the plugins for local and global
Global in vscode extensions:
local:
pip install —dev autopep8 pep8 pylint pylint_django
Press CTRL+SHIFT+P(CMD+SHIFT+P for MacOS) -> ">select interpreter" -> select your virtual envirnoment https://i.ibb.co/TTfkHRF/select-vir.gif
open vscode/setting.json
file and past the beneath config code:
{
....
"editor.formatOnSave": true,
"python.formatting.provider": "autopep8",
"python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"--load-plugin=pylint_django"
]
}
Upvotes: 5
Reputation: 1755
You can install and activate python & Microsoft AI extension in visual studio code.
Upvotes: 6