Chapter 2. Django Quick Start

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.

1. Go to the official site and select your OS.

Install-Visual-Studio-Code

2. Go to the downloads folder. Drag and drop the Visual Studio Code.app icon onto the Application folder.

Install-Visual-Studio-Code

3. Open Launchpad from the Dock. You can find the Visual Studio Code app.

Install-Visual-Studio-Code

4. To create an icon in the Dock, drag and drop the Visual Studio Code app onto the Dock from Launchpad.

Install-Visual-Studio-Code

5. You can open the VS Code from the Dock now.

Install-Visual-Studio-Code

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.

  1. Your project directory structure
  2. Text file contents with multiple tabs
  3. 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.

Install-Visual-Studio-Code

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.

  1. Click on the Extension icon on the left sidebar
  2. Type "python" in the search bar and search extensions
  3. Select the Python extension and press the Install button

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.

1. Go to the official site and select your OS.

Install-Visual-Studio-Code

2. Go to the downloads folder. Drag and drop the Visual Studio Code.app icon onto the Application folder.

Install-Visual-Studio-Code

3. Open Launchpad from the Dock. You can find the Visual Studio Code app.

Install-Visual-Studio-Code

4. To create an icon in the Dock, drag and drop the Visual Studio Code app onto the Dock from Launchpad.

Install-Visual-Studio-Code

5. You can open the VS Code from the Dock now.

Install-Visual-Studio-Code

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.

  1. Your project directory structure
  2. Text file contents with multiple tabs
  3. 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.

Install-Visual-Studio-Code

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.

  1. Click on the Extension icon on the left sidebar
  2. Type "python" in the search bar and search extensions
  3. Select the Python extension and press the Install button

Install-Visual-Studio-Code