This file is used to describe how to develop and debug the project locally.
In order to use a virutal enviroment, in Ubuntu 20, use:
apt install python3.8 python3.8-venv python3-venv
python -m venv .venv
open virtual enviroment
source .venv/bin/activate
# then you can install dependencies
pip install -r requirements.txt
to close virtual enviroment, use
deactivate
when you download the projects, use
python manage.py db upgrade
to build tables in the app.sqlite, which is a local db file without running a mysql instance or other db service.
when you change some fields in any table, use
python manage.py db migrate
to records these changes.
python manage.py runserver -h 0.0.0.0
When you run the docker-compose up
command, you can add the --build
option to force the rebuilding of the service's image.
docker-compose up --build
You can also use the docker-compose build
command to rebuild the images before starting the services.
docker-compose build
docker-compose up
If you want to not only rebuild the images but also force the recreation of containers when starting the services, you can use the --force-recreate
option.
docker-compose up --build --force-recreate
If you want to completely remove old images and containers and then rebuild and start the services, follow these steps:
-
Stop and remove all containers:
docker-compose down
-
Remove old images:
docker image prune -f docker rmi $(docker images -q)
-
Rebuild and start the services:
docker-compose up --build