Welcome to Django Tasker Exchange Rate documentation!

https://travis-ci.org/kostya-ten/django_tasker_exchangerate.svg?branch=master Documentation Status https://api.codacy.com/project/badge/Grade/86a209db0a9d4b0b89b5a4068d71520d

Requirements

  • Python 3.6+
  • A supported version of Django (currently 2.2.4)

Getting It

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

Installation

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',
    # ...
)

Using

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)

Update

You can update the exchange rate using cron

14   00   *   *   *   root    test -x manage.py && manage.py exchangerate --action=cbrf