Skip to content

CryptoProcessing/tickers

Repository files navigation

virtualenv -p python3 venv
source venv/bin/activate

рекомендуется
sudo apt-get install python3.5-dev

pip3 install -r requirements.txt

Create DB and user

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

start gunicorn

конфиг 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

manual start celery

celery worker -A ticker.celery_worker.celery --loglevel=info

or

start celery daemon

конфиг 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

crontab

Add line.

*/5 * * * * /home/deployer/tickers/venv/bin/python3 /home/deployer/tickers/manage.py runtickers

Restart all

sudo bash /home/deployer/ticker/restart.sh

Usage

/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

Version

python manage.py version

or

/api/version

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •