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.8.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dj_currencies-1.8.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dj_currencies-1.8.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dj_currencies-1.8.0.tar.gz
Algorithm Hash digest
SHA256 4527dd65e0bf5b24d0af9ea2eb2b22ee93caa3867649110814eae203a3f26fde
MD5 c7ab07f122db4b0a333b2fa2d6239186
BLAKE2b-256 df4871d81d88cba8949f62f60de1a84ca11eb0a378599d499310ed4dea436344

See more details on using hashes here.

Provenance

The following attestation bundles were made for dj_currencies-1.8.0.tar.gz:

Publisher: ci.yml on CoverGenius/dj-currencies

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: dj_currencies-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dj_currencies-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34e5e4db804c5370e5ad93c73feb46f5d3d5d51ed1a3ea506fcc5b42f0002f52
MD5 b5b649e800b29eff5c06484cea24a91f
BLAKE2b-256 6e9879e7ce4b8f3eabfe9a1536e8dd739c42ed5dd9027361db5bfddfc217716f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dj_currencies-1.8.0-py3-none-any.whl:

Publisher: ci.yml on CoverGenius/dj-currencies

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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