Git Product home page Git Product logo

dj-currencies's Introduction

image

Documentation

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

Quickstart

version 1.0.0 supports Django 3+ only

For Django 2 support, please use version 0.1.2

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

Note

You will need to have at least "OPENEXCHANGE_APP_ID" configured if you use OpenExchangeBackend

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

dj-currencies's People

Contributors

tyomo4ka avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.