For your information, I am going to use Microsoft Visual Code Studio to develop Python software based on django.


  1. Install Visual Code Studio
  2. Install Python Extension - https://marketplace.visualstudio.com/items?itemName=ms-python.python
  3. Install a version of Python 3 by visiting at https://python.org/downloads/
    I recommend you to install the latest version when you download the installer. In my case, I will install Python 3.7.1.
    When you run the installer, please check the box next to Add Python *.* to PATH and then click Install Now.



    Once installation is done, do not forget to check to run below commands on DOS, so we can make sure that python is correctly installed.

    python --version

    If you can't see version information like below. I recommend you to uninstall and try install again. Please do not forget to check "Add Python . to PATH" like above picture.

  4. Install virtualenv and virtualenvwrapper

    virtualenv and virtualenvwrapper provide a dedicated environment for each Django project you create. While not mandatory, this is considered a best practice and will save you time in the future when you’re ready to deploy your project. Simply type:

    pip install virtualenvwrapper-win


    Then create a virtual environment for your project:

    mkvirtualenv venv


    The virtual environment will be activated automatically and you’ll see “(venv)” next to the command prompt to designate that. If you start a new command prompt, you’ll need to activate the environment again using:

    workon venv
  5. Open the project folder by running VS Code and using the File > Open Folder command.

  6. In VS Code, open the Command Palette (View > Command Palette or (CTRL+SHIFT+P)). Then select the Python: Select Interpreter command:

    And select your virtual environment 'venv' as you created



  7. Run Terminal: Create New Integrated Terminal (CTRL+SHIFT+`) from the Command Palette, which creates a terminal and automatically activates the virtual environment by running its activation script.

    If you face error like below on windows 10, that might be caused by system security policy.


    Then please run below command to remove that restriction:

    Set-ExecutionPolicy Unrestricted -Force

    The action you should do is just closing the terminal and running it again.

  8. The selected environment appears on the left side of the VS Code status bar, and notice the "(venv)" indicator that tells you that you're using a virtual environment:


  9. Install Django in the virtual environment by running one of the following commands in the VS Code Terminal:

    pip install django

You now have a self-contained environment ready for writing Django code. VS Code activates the environment automatically when you use Terminal: Create New Integrated Terminal.


The documentation I referenced is actually located at https://code.visualstudio.com/docs/python/tutorial-django, so you can know more if you have any additional doubt or curious.