IDE Setup
Setting up a dev envΒΆ
Please follow the Kartoza coding standards.
πββοΈ How To Run Project with Visual Studio CodeΒΆ
Copy and customize environnment file: Create a copy of the deployment/.template.env
file and name it deployment/.env
. Update the deployment/.env
file with your project-specific settings.
Add a .env
file in the project root directory with the below content:
This is to ensure the containers that VS Code builds are using that project name. For more information, follow this link.
Ensure Dev Containers extension is installed
Build and open project in devcontainer: press Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux) to open the Command Palette. Type Dev Containers: Rebuild and Reopen in Container
and select it to reopen the folder inside the devcontainer.
Change the permissions of the django_project folder:
Install dependencies inside the container: Press Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux), type Tasks: Run Tasks
and select it. Choose React: Install dependencies
to install the necessary dependencies.
Run the migrations inside the container: Press Cmd+Shift+P
(macOS) or Ctrl+Shift+P
(Windows/Linux), and type Tasks: Run Tasks
and select it. Choose Django: Migrate
.
π©βπ» Open the developer siteΒΆ
Run the project inside the container: Press Cmd+Shift+D
(macOS) or Ctrl+Shift+D
(Windows/Linux), and choose Django+React
in the RUN AND DEBUG dropdown.
Review the list of forwarded ports from the container to your local host:
Open your web browser and go to localhost:8000 to view the running application.
π©βπ Create a super userΒΆ
π½ Restoring layer schema for mapΒΆ
The full dump file for layer schema is ~5.3GB, meanwhile compact dump file is only 24MB.
Download Full Dump File for Layer.
Download Compact Dump File for Layer.
Preview for compact dump file:
Copy the dump file to db container. Then run pg_restore from inside db container to restore the dump file.
docker cp sanbi_layer_db_compact.dump deployment-db-1:/home/sanbi_layer_db_compact.dump
docker exec -it deployment-db-1 /bin/bash
cd /home
pg_restore -h 127.0.0.1 -U docker -d django -n layer sanbi_layer_db_compact.dump
Load FixturesΒΆ
To load fixtures into your database, you can use the loaddata
management command.
Run this command to load all the fixtures.
Run this command to load the specific fixture.