Monday, April 30, 2018

Re: Django and Visual Studio Code

On Monday, April 30, 2018 at 4:38:51 AM UTC-7, Simon Connah wrote:
I've got most of Visual Studio Code configured for Django development
(I'm trying it out to see if I can ditch PyCharm and save some money)
and almost everything seems OK.

After moving through BBEdit, TextMate, Sublime and Atom over the years, I'm feeling like VSCode is the most polished, professional editor/IDE I've ever used (never did the pycharm thing). Learn a dozen keyboard shortcuts, and it's like it's reading your mind. 

I set the Python path to be the one in the virtual environment, and if
Visual Studio Code needs to install any modules, they go into the
virtual environment.

I use pipenv, and don't like this approach, as it rewrites Pipfile, which is in vcs and gets shared with the team, who all use different editors. I assume it does similar for requirements.txt. Dependencies specific to a given editor should not be forced on an editor-agnostic team. 

The major problem is that when I open a terminal in Visual Studio
Code, it doesn't automatically activate the virtual environment, so I
have to source it manually.

When you open a bash terminal, does it automatically activate an environment? I wouldn't expect it to be different in the editor's terminal, and `pipenv shell` still works normally. That said, you might be able to pass startup arguments via `terminal.integrated.shellArgs.*`

In addition to that, I haven't managed to get debugging working even
after reading a few tutorials on the subject.

You haven't really told us what's working/not working or how you've gone about setting it up. I just use icecream and good old pdb and log statements (haven't tried deep vscode integration). 


You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment