21. Skip to content

21. Building the dev environment

This section covers the process of building and running the application from your IDE.

🚩 Make sure you have gone through the IDE Setup Process before following these notes.

Press Ctrl -> P 1️⃣ and then >and search for Rebuild. Select Dev Containers: Rebuild and Reopen in Container2️⃣. This will essentially mount your code tree inside a docker container and switch the development context of VSCode to be inside the container where all of the python etc. dependencies will be installed.

image.png

Once the task is running, a notification 1️⃣ will be shown in the bottom right of the VSCode window. Clicking in the notification will show you the setup progress 2️⃣. Note that this make take quite a while depending on the internet bandwidth you have and the CPU power of your machine.

image.png

21.1 Open a dev container terminal

Open terminal within the dev container context by clicking the +icon in the terminal pane 1️⃣. The new terminal 2️⃣ will show up in the list of running terminals 3️⃣

image.png

21.2 Install FrontEnd libraries

cd /home/web/project/django_project/dashboard
npm install --legacy-peer-deps

image.png

21.3 Run django migration

cd /home/web/project/django_project
python manage.py migrate

21.4 Create super user

cd /home/web/project/django_project
python manage.py createsuperuser

During this process you will be prompted for your user name (defaults to root), email address and a password (which you need to confirm). Complete these as needed.

21.5 Run the development server

Activate the Run and Debug tab 1️⃣ then select Django + React from the list of runners 3️⃣ and then press the Run icon 2️⃣. After doing this, the console should update indicate that the site can be opened at http://127.0.0.1:2000/

image.png

21.6 Viewing your test instance

After completing the steps above, you should have the development server available on port 2000 of your local host:

http://localhost:2000

image.png

The site will be rather bare bones since it will need to be configured in the admin area to set up the theme etc.

🪧 Now that you have the built the project, move on to the Design documentation.


Last update: September 6, 2023