Skip to main content

A reusable Django app that integrates https://openexchangerates.org/

Project description

Documentation

The full documentation is at https://dj-currencies.readthedocs.io.

Quickstart

For Django 2 support, please use version 0.1.2. Django 3 support added in version 1.0. Django 4 support from version >=1.1.

Install djcurrencies:

pip install dj-currencies

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'dj_currencies',
    ...
)

Settings

DJANGO_CURRENCIES = {
    'DEFAULT_BACKEND': 'djmoney_rates.backends.OpenExchangeBackend',
    'OPENEXCHANGE_APP_ID': '',
    'BASE_CURRENCIES': ['USD'],
    'MAX_CACHE_DAYS': 7
}

DEFAULT_BACKEND: The selected backend to sync exchange rates

OPENEXCHANGE_APP_ID: Must be configured if you use OpenExchangeBackend

BASE_CURRENCIES: A list of base currencies to use. At the time of this version, you will only be able to convert currency from any one of the base currency to target currency.

MAX_CACHE_DAYS: Only use the cache within this time limit. If exchange rates was not synced within the time frame, an exception will thrown

Features

  • [open exchange rates](openexchangerates.org) integration

  • Extensible backend design, hook your own exchange rate sources

  • Multi base currencies support, no double conversion to lose precision

  • Store historical exchange rates

  • offline currency conversion

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj_currencies-1.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

dj_currencies-1.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file dj_currencies-1.1.0.tar.gz.

File metadata

  • Download URL: dj_currencies-1.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dj_currencies-1.1.0.tar.gz
Algorithm Hash digest
SHA256 14bbc702dc67afb725c7b5405b1960064ae5f8dbde652d0ccde3115004329c6b
MD5 3a97962e52599c51564f23ee31d4fd85
BLAKE2b-256 fea01d963686c1bff048f114f9273815cbac0fc7a5db471bd06697a71858bf86

See more details on using hashes here.

File details

Details for the file dj_currencies-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dj_currencies-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cb8a598a9e899ab1a0ec80037f4bed90aa5d84716cbd574cbfea5885d7efdfb
MD5 7b132b53640c9bd6c9e65ee6425efa49
BLAKE2b-256 5475730b15923c97846ed81fd72de848e9e113916fe04d1a3e43e2f59a271cdf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page