virtualenv -p python3 venv
source venv/bin/activate
рекомендуется
sudo apt-get install python3.5-dev
pip3 install -r requirements.txt
mysql -u root -p
CREATE DATABASE tickers;
For tests
CREATE DATABASE tickers_test;
GRANT ALL ON tickers.* TO tickers@localhost IDENTIFIED BY 'tickers';
GRANT ALL ON tickers_test.* TO tickers@localhost IDENTIFIED BY 'tickers';
только один раз
python manage.py db init
при каждом изменении
python manage.py db migrate
конфиг Gunicorn из папки extra/systemd/gunicorn.service в /etc/systemd/system
systemctl daemon-reload
systemctl start gunicorn.service
systemctl status gunicorn.service
systemctl restart gunicorn.service
проверка ps xa | grep gunicorn
#run celery worker
celery worker -A ticker.celery_worker.celery --loglevel=info
or
конфиг Celery из папки extra/systemd/celery.service в /etc/systemd/system конфиг Celery из папки extra/systemd/celeryd в /etc/default
systemctl daemon-reload
systemctl start celery.service
systemctl status celery.service
systemctl restart celery.service
Add line.
*/5 * * * * /home/deployer/tickers/venv/bin/python3 /home/deployer/tickers/manage.py runtickers
sudo bash /home/deployer/ticker/restart.sh
/api/v1/data/price?pair=BTC:USD&ts=1513888428&market=2&format=string
`format` = `string` or `float`. Default value is `float`
all parameters are optional
python manage.py version
or
/api/version