13. 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.
13.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
13.1.1 Copying the .env¶
Copy the template.env
to .env
Edit the .env
file and change the
to
13.1.2 Override Docker configurations¶
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.
13.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
13.3 Setup interpreter¶
-
Go to File -> Settings -> Project -> Project Interpreter. Then click on the cog -> add
-
Go to the ssh interpreter tab and fill in the form as below
-
Click next and fill in docker as the password
-
Click next and change the interpreter as below, then click finish.
-
After you click finish, it will show all of the packages 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.
13.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 (by 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
13.5 Quick setup guide¶
⛔️📒 This content needs to be reviewed and moved to the readme.
13.5.1 Production¶
git clone https://github.com/project-name/repository
cd project-name/deployment
docker-compose up -d
The web will be available at http://127.0.0.1/
To stop containers:
To stop and delete containers:
13.5.2 Development¶
git clone https://github.com/project-name/repository
cd project-name/deployment
cp .template.env .env
cp docker-compose.override.template.yml docker-compose.override.yml
After that,
- 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 is on.
The web can be accessed using http://localhost:2000/
If the web is taking long time to load, restart project-name_dev container by make dev-reload
.
The sequence should be make frontend-dev
, after that run or restart project-name_dev.
To stop dev:
To reload container: