{ "info": { "author": "Basil Shubin", "author_email": "basil.shubin@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-simple-currencies\n===\n\ndjango-simple-currencies allows you to define different currencies, and includes template tags / filters to allow easy conversion between them.\n\n[![Latest Version](https://pypip.in/version/django-simple-currencies/badge.svg)](https://pypi.python.org/pypi/django-simple-currencies/)\n[![Downloads](https://pypip.in/download/django-simple-currencies/badge.svg)](https://pypi.python.org/pypi/django-simple-currencies/)\n[![License](https://pypip.in/license/django-simple-currencies/badge.svg)](https://pypi.python.org/pypi/django-simple-currencies/)\n\n## Setup\n\nEither clone this repository into your project, or install with ```pip install django-simple-currencies```\n\nYou'll need to add ```currencies``` to ```INSTALLED_APPS``` in your project's ``settings.py`` file :\n\n```python\nINSTALLED_APPS = (\n ...\n 'currencies',\n)\n```\n\nAdd ```currencies.middleware.CurrencyMiddleware``` to ```MIDDLEWARE_CLASSES```, must be after ```django.contrib.sessions.middleware.SessionMiddleware``` : \n\n```python\nMIDDLEWARE_CLASSES = (\n ... \n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'currencies.middleware.CurrencyMiddleware', # must be after 'SessionMiddleware'\n ...\n)\n```\n\nIf you're going to use site-wide caching, add ```currencies.middleware.CacheCurrencyMiddleware```, but before ```django.middleware.cache.FetchFromCacheMiddleware``` : \n\n```python\nMIDDLEWARE_CLASSES = (\n ...\n 'currencies.middleware.CacheCurrencyMiddleware', # must be before 'FetchFromCacheMiddleware'\n 'django.middleware.cache.FetchFromCacheMiddleware', \n)\n```\n\nBe sure you have the `django.core.context_processors.request` context processor listed in ```TEMPLATE_CONTEXT_PROCESSORS``` : \n\n```python\nTEMPLATE_CONTEXT_PROCESSORS = [\n ...\n \"django.core.context_processors.request\"\n]\n```\n\nAnd don't forget to add this line to your site's root URLConf :\n\n```python\nurl(r'^currencies/', include('currencies.urls')),\n```\n\nThen run ```./manage.py syncdb``` to create the required database tables\n\n\n## Configuration\n\ndjango-simple-currencies has built-in integration with [Open Exchange Rates](http://openexchangerates.org/)\n\nYou will need to specify your API key in your ```settings.py``` file :\n\n```python\nOPENEXCHANGERATES_APP_ID = \"c2b2efcb306e075d9c2f2d0b614119ea\"\n```\n\nYou will then be able to use the management commands ``currencies`` and ``update_rates``. The former will import any currencies that are defined on [Open Exchange Rates](http://openexchangerates.org/). You can selectively import currencies, for example bellow command will import USD and EUR currencies only :\n\n```shell\n./manage.py currencies --import=USD --import=EUR\n```\n\nThe ``update_rates`` management command will update all your currencies against the rates returned by [Open Exchange Rates](http://openexchangerates.org/). Any missing currency will be left untouched.\n\n## Usage\n\nFirst of all, load the ```currencies``` in every template where you want to use it :\n\n {% load currencies %}\n \nto get a list of the active currencies :\n\n {% get_currencies as CURRENCIES %}\n \nto get the currently set currency :\n\n {% get_current_currency as CURRENCY %}\n \nand then to convert to a given currency :\n\n {% change_currency [amount] [currency_code] %}\n\nor use the filter :\n\n {{ [amount]|currency:[currency_code] }}\n\nPlease see ```example``` application. This application is used to manually test the functionalities of this package. This also serves as a good example.\n\nYou need only Django 1.4 or above to run that. It might run on older versions but that is not tested.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bashu/django-simple-currencies", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-simple-currencies", "package_url": "https://pypi.org/project/django-simple-currencies/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-simple-currencies/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/bashu/django-simple-currencies" }, "release_url": "https://pypi.org/project/django-simple-currencies/0.1/", "requires_dist": null, "requires_python": null, "summary": "Currency, exchange rate and conversions support for django projects", "version": "0.1" }, "last_serial": 1504693, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1731b31c7f9cc064e183163d25f98cd5", "sha256": "62d0038a926967130e84286c774c009da4f5d0f25ff93e6939e2dea529fe0e7f" }, "downloads": -1, "filename": "django-simple-currencies-0.1.tar.gz", "has_sig": true, "md5_digest": "1731b31c7f9cc064e183163d25f98cd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11422, "upload_time": "2015-04-14T11:03:48", "url": "https://files.pythonhosted.org/packages/3c/0f/807bbaec3672ced0ff24d88be274cbe32f9d6cf31f1336c1d566d249fc3b/django-simple-currencies-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1731b31c7f9cc064e183163d25f98cd5", "sha256": "62d0038a926967130e84286c774c009da4f5d0f25ff93e6939e2dea529fe0e7f" }, "downloads": -1, "filename": "django-simple-currencies-0.1.tar.gz", "has_sig": true, "md5_digest": "1731b31c7f9cc064e183163d25f98cd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11422, "upload_time": "2015-04-14T11:03:48", "url": "https://files.pythonhosted.org/packages/3c/0f/807bbaec3672ced0ff24d88be274cbe32f9d6cf31f1336c1d566d249fc3b/django-simple-currencies-0.1.tar.gz" } ] }