diff --git a/docker/env.example b/docker/env.example index 86696f8..cd48ba6 100644 --- a/docker/env.example +++ b/docker/env.example @@ -4,3 +4,6 @@ POSTGRES_DB=trader POLONIEX_API_KEY= POLONIEX_API_SECRET= + +PYTRADER_USER=trader +PYTRADER_PASSWORD=trader \ No newline at end of file diff --git a/readme.md b/readme.md index 05b3f03..aa47e39 100644 --- a/readme.md +++ b/readme.md @@ -237,11 +237,12 @@ cp pypolo/local_settings.py.example pypolo/local_settings.py ``` 1. Add your POLONIEX_API_KEY and POLONIEX_API_SECRET to docker/env (its gitignored, dont worry) -2. Build Docker image (compiling stuff for scipy and numpy takes time): `docker-compose build` or pull the images from Docker Hub: `docker-compose pull` +2. Set your PYTRADER_LOGIN and PYTRADER_PASSWORD to docker/env. This will set the login you use to access the site. +3. Build Docker image (compiling stuff for scipy and numpy takes time): `docker-compose build` or pull the images from Docker Hub: `docker-compose pull` 4. Run the containers: `docker-compose up` 5. Get shell: `docker exec -it pytrader_web_1 /bin/bash` -6. Place sql seed in this repo dir as `prices.psql` -7. in Django container +6. Place sql seed in this repo dir as `prices.psql`, or see PSQL_NOTES below +7. in Django container ``` cd /root/pytrader @@ -254,6 +255,21 @@ wait for the psql load to end 9. Visit http://localhost:8000/admin and log in as `trader:trader` +PSQL_NOTES +PSQL seed is available from: http://dumps.snipanet.com/ +Newest seed is available at http://dumps.snipanet.com/history_price-latest.psql.gz + +Script that can be run to update the first time: +``` +cd /root/pytrader +wget http://dumps.snipanet.com/history_price-latest.psql.gz +gunzip history_price-latest.psql.gz +export PGPASSWORD=$POSTGRES_PASSWORD +psql -h db -U trader trader < history_price-latest.psql +rm -f history_price-latest.psql +``` + +