Skip to main content

openexchangerates.org support for django-prices

codecov PyPI - Version PyPI - Downloads PyPI - Python Version

from prices import Money
from django_prices_openexchangerates import exchange_currency

converted_price = exchange_currency(Money(10, currency='USD'), 'EUR')
print(converted_price)
# Money('8.84040', currency='EUR')

It will also create additional steps if it cannot convert directly:

from prices import Money
from django_prices_openexchangerates import exchange_currency

converted_price = exchange_currency(Money(10, currency='GBP'), 'EUR')
print(converted_price)
# Money('13.31313588062401085236264978', currency='EUR')

The exchange_currency supports Money, TaxedMoney, MoneyRange and TaxedMoneyRange.

Template filters can be used with django-prices to convert currency, round amounts and display localized amounts in templates:

{% load prices_i18n %}
{% load prices_multicurrency %}

<p>Price: {{ foo.price.gross|in_currency:'USD'|amount }} ({{ foo.price.net|in_currency:'USD'|amount }} + {{ foo.price.tax|in_currency:'USD'|amount }} tax)</p>

Installation

First install the package:

pip install django-prices-openexchangerates

Then add 'django_prices_openexchangerates' to your INSTALLED_APPS.

Set following settings in your project's settings:

  • OPENEXCHANGERATES_API_KEY

  • OPENEXCHANGERATES_BASE_CURRENCY (defaults to 'USD', only premium accounts support other bases)

Use your admin console to create ConversionRate objects for each currency that you want to support.

Updating exchange rates

Fetch current rates from API with ./manage.py update_exchange_rates

Schedule this task in cron job or in celery, to be always up to date with exchange rates

You can use --all flag in above command, to create exchange rates automatically for all available currencies.


Crafted with ❤️ by Mirumee Software

hello@mirumee.com

Metadata

Release files for django-prices-openexchangerates 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-prices-openexchangerates 1.3.0
File Size Uploaded
django_prices_openexchangerates-1.3.0.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-prices-openexchangerates 1.3.0
File Interpreter ABI Platform
django_prices_openexchangerates-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.6 kB

Release files / django_prices_openexchangerates-1.3.0.tar.gz

Download URL django_prices_openexchangerates-1.3.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8d44a74edda5b3fc7db666b0bf437eaa5b2e7ca135a8f5d7752ed389a76d54aa
BLAKE2b-256 checksum
How to use checksums
1578c3080f3faa5e64343105119903239070bd64e82fe107d4e129397fa50cdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2025.

Transparency log

Release files / django_prices_openexchangerates-1.3.0-py3-none-any.whl

Download URL django_prices_openexchangerates-1.3.0-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bc3f8f01cba9dcb864c3a0f1ce3ee59b4baa1d8aea3ab273f5e482c5dfc67ae
BLAKE2b-256 checksum
How to use checksums
0eade2d94a195426cc192d9643446b29f4a3d83c712f472a543441624666ccdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

1 release file

1.0.0

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page