- Python 3.6+
- A supported version of Django (currently 2.2.4)
You can get Django Tasker Exchange Rate by using pip:
$ pip install django-tasker-exchangerate
If you want to install it from source, grab the git repository from GitHub and run setup.py:
$ git clone git://github.com/kostya-ten/django_tasker_exchangerate.git $ cd django_tasker_exchangerate $ python setup.py install
To enable django_tasker_exchangerate
in your project you need to add it to INSTALLED_APPS in your projects settings.py
INSTALLED_APPS = (
# ...
'django_tasker_exchangerate',
# ...
)
from django_tasker_exchangerate import exchangerate
exchange = exchangerate.CBRF()
model = exchange.model()
result = model.objects.get(last=True, code="USD", source=1)
print(result.value)
You can update the exchange rate using cron
14 00 * * * root test -x manage.py && manage.py exchangerate --action=cbrf