43. Setting up your IDE¶
This section outlines the process for configuring your IDE for development.
🚩 Make sure you have gone through the Cloning Section before following these notes.
43.1 VS Code Setup¶
Open the project in VSCode (1️⃣, 2️⃣) by navigating the the place on your file system where you checked out the code in the pre-requisites step above (3️⃣).
Accept the 'trust authors' prompt
43.1.1 Install necessary extension¶
Before proceeding, please ensure that the necessary extension is installed. Navigate to the Extensions panel (1), then search for and install the DevContainers extension (2).
43.1.2 Copying the .env¶
Copy the template.env
to .env
Edit the .env
file and change the
43.1.3 Override Docker Configs¶
We are going to copy the docker overrides template to a local file that will not be under version control.
Rename the file to docker-compose.override.yml
Initially you will not need to change anything in this file, though you may want to take a look through the various configurations provided here if you want to tweak your local setup.
Now that you have your IDE set up, we can move on to building the project.
43.2 Using pycharm¶
📒 ⛔️ This section needs to be reviewed and organised into our docs framework.
This section is for using pycharm.
Requirements:
- Pycharm
- Finished Setting up the project
43.3 Setup interpreter¶
-
Go to file -> setting -> Project -> Project Interpreter -> click cog -> add
-
Go to ssh interpreter -> Fill the form like below
-
Click next and fill docker as password
-
Click next and change interpreter like below and click finish
-
After finish, it will show all package like below.
-
In current page, click path mappings, click + button and put local path to where the project (django-project folder) and remote path is like below. and click oK.
Now the interpreter is done. When we restart the machine, we need to do make up
to run the project.
43.4 Setup run configuration¶
After the interpreter is done, we need configuration to run the project in development mode.
-
Click "Add configuration" like in the cursor in the image below. (top-right)
-
There will be a popup, and click +, then click django server like below
-
It will show the form and fill like below.
-
Don't click the OK yet, but click Environment Variables and add environments like below 9by clicking + button).
-
After that, click OK.
-
Now we need to run the server by clicking go button in below image.
-
When we click the go button, pycharm will run a process until like image below.
-
Now it is done. We can access the development server in http://localhost:2000/
This development mode is DEBUG mode, and also whenever we change the code, the site will also change in runtime.
For more information how to set up on pycharm, please visit Using a Docker Compose-Based Python Interpreter in PyCharm
43.5 Quick Setup Guide¶
⛔️📒 This content needs to be reviewed and moved to the readme.
43.5.1 Production¶
The web will be available at http://127.0.0.1/
To stop containers:
To stop and delete containers:
43.5.2 Development¶
git clone https://github.com/unicef-drp/GeoSight-OS
cd GeoSight-OS/deployment
cp .template.env .env
cp docker-compose.override.template.yml docker-compose.override.yml
After that, do - open new terminal - on folder root of project, do
Wait until it is done when there is sentence "webpack xxx compiled successfully in xxx ms".After that, don't close the terminal. If it is accidentally closed, do
make frontend-dev
again
Next step: - Open new terminal - Do commands below
wait until it says
*** Operational MODE: preforking ***
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x55e78f7927d0 pid: 1 (default app)
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 1)
spawned uWSGI worker 1 (pid: 194, cores: 1)
spawned uWSGI worker 2 (pid: 195, cores: 1)
unable to stat() /tmp/touch-me-to-reload, events will be triggered as soon as the file is created
After that, do below commands:
or on new terminalWait until it is done.
The web can be accessed using http://localhost:2000/
If the web is taking long time to load, restart geosight_dev container by make dev-reload
.
The sequence should be make frontend-dev
, after that run or restart geosight_dev.
To stop dev:
To reload container: