Install Visual Studio Code
For Django app coding, you can use a simple text editor and a command line; however, using an advanced code editor tool such as Visual Studio Code (VS Code) can improve your coding productivity. VS Code is a free software provided by Microsoft. It is one of the most popular code editors among code developers. In this course, we use VS Code as a default editor.
Install and prepare VS Code on your desktop
VS Code is available on the VS Code's official site.
Here are the steps to install and prepare the VS Code app on your desktop with Mac OS examples.
- Go to the official site and select your OS.
- Go to the downloads folder. Drag and drop the Visual Studio Code.app icon onto the Application folder.
- Open Launchpad from the Dock. You can find the Visual Studio Code app.
- To create an icon in the Dock, drag and drop the Visual Studio Code app onto the Dock from Launchpad.
- You can open the VS Code from the Dock now.
Key features of VS Code
There are many features of VS Code. As a beginner, you'll find it to be a valuable tool because of its integrated user interface.
For example, you can see the following views on the same screen.
- Your project directory structure
- Text file contents with multiple tabs
- Terminal (command line) to run commands
Using VS Code, you can also open two active files side-by-side. This is helpful when you want to compare the code in a file with the code in another file. Click on the top right icon to split the active editor into two.
Extensions
VS Code has many extensions that provide helpful features, such as a Remote Development extension for SSH connection and a Docker extension to manage Docker assets. Python extension is a popular extension used for Python code debugging, code formatting, and several other purposes.
With the three steps below, you can install the Python extension.
- Click on the Extension icon on the left sidebar
- Type "python" in the search bar and search extensions
- Select the Python extension and press the Install button