- docker and docker-compose
docker-compose build
docker-compose up
docker-compose down
On every setup, database migration is required
docker-compose exec django manage migrate
If manage script does not work then
docker-compose exec django python manage.py migrate
docker-compose exec django manage makemigrations
docker-compose exec django manage generate_dev_tokens -u <user> -p <password> -e <email>
Enter django container shell
docker-compose exec django bash
Run all the tests
pytest .
Run specific test
pytest -vv -x -k <test_name>
Enter into container through command below or using docker desktop
docker-compose exec postgres bash
psql -U postgres -d postgres
To list all the tables
\dt
Installing pipenv to python3
pip install pipenv
How to add package to pipenv
- Adding line to Pipfile
pytest-django= "==4.5.2"
- Executing command in terminal
pipenv install "pytest-django==4.5.2"
Load exchanges into database
docker-compose exec django python manage.py insert_exchanges_to_db