This app is example load currencies from bitfinex.com using their API
-
Getting rate info by currency with average between last 10 days, by default
/api/rate/<id_currency> -
Getting list currencies with the option paginate
/api/currencies?page=<num>&perPage=<num>
pip install -r requirements.txt
export FLASK_APP=app.py
Use the config.py
or instance/config.cfg
how instance config.
Fill SQLALCHEMY_DATABASE_URI or set next environment variables:
export DATABASE_NAME='' DATABASE_USER='' DATABASE_HOST='' DATABASE_PASSWORD=''
for connect to your DB. Uses PostgreSQL by default.
flask db init
flask db upgrade
if you will change models need use migrate with next upgrade
flask db migrate
flask db upgrade
If you want add anything currency you should fill fixtures in make_default_currency
inside project/fixtures.py
.
Currency should be available on bitfinex.com.
flask first-filling
flask test-user
User for testing have next login and password test:test
Loading the rates from bitfinex.com by all currency from database
flask load
flask run