After I finish my project and move it to docker, I met some very strange problems related to database. I did run
sudo docker-compose run web python3 manage.py makemigrationssudo docker-compose run web python3 manage.py migrate
but both of them shows no change detected.
After trying everything I can find but failed, I decided to clean up all the containers and then rebuild them.
sudo docker rm $(sudo docker ps -a -q) -f
sudo docker volume prune
If you don't want to delete all volumes, you can delete a particular one
sudo docker volume lssudo docker volume rm <name_of_volume>
3. Rebuild them
sudo docker-compose up --build