-
remove mini_Amazon/web-app/amazon/migrations directory.
-
run
make clean
in mini_Amazon/server. -
run
chmod o+x mini_Amazon/server/run.sh
(If it does not work, delete and recreate a new run.sh file) -
make sure to change database settings in mini_Amazon/web-app/ERSSHW5/settings.py
-
make sure to use correct statment in Server::connnectDB(), which is located at server.cpp.
-
change world and ups hostname in the constructor of class Server, which is loacted at server.cpp.
-
sudo docker-compose down
-
sudo docker-compose build
-
sudo docker-compose up
Then Django framework will generate migration file and create database and related tables automatically.
- after running the docker, use
sudo docker ps -a
to find the container ID for mini_amazon_web IMAGE. - run
sudo docker exec -it ${CONTAINER_ID} python3 manage.py createsuperuser
- follow the instruction to create a super user
- run initserver.sh
- run runserver.sh
psql -U postgres mini_amazon
password ispassw0rd
- run
truncate item cascade;
- run
truncate shoppingcart;
- run
alter sequence orders_pack_id_seq restart with 1;