{ "info": { "author": "Andrew Cordery", "author_email": "cordery@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6" ], "description": "=============================\nDjango Languages Plus\n=============================\n\n.. image:: https://badge.fury.io/py/django-countries-plus.svg\n :target: https://badge.fury.io/py/django-countries-plus\n\n.. image:: https://travis-ci.org/cordery/django-countries-plus.svg?branch=master\n :target: https://travis-ci.org/cordery/django-countries-plus\n\n.. image:: https://codecov.io/gh/cordery/django-countries-plus/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/cordery/django-countries-plus\n\n\n\nThe Country Model\n-----------------\n\nThe model provides the following fields (original geonames.org column name in parentheses).\n\n* iso (ISO)\n* iso3 (ISO3)\n* iso_numeric (ISO-Numeric)\n* fips (fips)\n* name (Country)\n* capital\n* area (Area(in sq km))\n* population (population)\n* continent (continent)\n* tld (tld)\n* currency_code (CurrencyCode)\n* currency_name (CurrencyName)\n* currency_symbol (Not part of the original table)\n* phone (Phone)\n* postal_code_format (Postal Code Format)\n* postal_code_regex (Postal Code Regex)\n* languages (Languages)\n* geonameid (geonameid)\n* neighbors (neighbours)\n* equivalent_fips_code (EquivalentFipsCode)\n\n\n\nInstallation\n------------\n\nStep 1: Install From PyPi\n\n``pip install django-countries-plus``\n\nStep 2: Add ``countries_plus`` to your INSTALLED_APPS\n\nStep 3: Run ``python manage.py sync`` (Django <1.7) or ``python manage.py migrate`` (Django 1.7+)\n\nStep 4: Load the Countries Data\n\n1. Load the countries data into your database with the update_countries_plus management command.\n ``python manage.py update_countries_plus``\n2. (alternative) Load the provided fixture from the fixtures directory.\n ``python manage.py loaddata PATH_TO_COUNTRIES_PLUS/countries_plus/countries_data.json.gz``\n\n\n\nUsage\n-----\n\n**Retrieve a Country**::\n\n from countries_plus.models import Country\n usa = Country.objects.get(iso3='USA')\n\n**Update the countries data with the latest geonames.org data**::\n\n python manage.py update_countries_data\n\nThis management command will download the latest geonames.org countries data and convert it into Country objects. Existing Country objects will be updated if necessary. No Country objects will be deleted, even if that country has ceased to exist.\n\n\nAdd the Request Country to each Request\n---------------------------------------\n\n1. Add ``countries_plus.middleware.AddRequestCountryMiddleware`` to your MIDDLEWARE setting.\n\n2. add the following two settings to your settings.py:\n\n ``COUNTRIES_PLUS_COUNTRY_HEADER`` - A string defining the name of the meta header that provides the country code. Ex: 'HTTP_CF_COUNTRY' (from https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-CloudFlare-IP-Geolocation-do-)\n\n ``COUNTRIES_PLUS_DEFAULT_ISO`` - A string containing an iso code for the country you want to use as a fallback in the case of a missing or malformed geoip header. Ex: 'US' or 'DE' or 'BR'\n\n Example::\n\n COUNTRIES_PLUS_COUNTRY_HEADER = 'HTTP_CF_COUNTRY'\n COUNTIRES_PLUS_DEFAULT_ISO = 'US'\n\n\nAdd the Request Country to the Request Context\n----------------------------------------------\n1. Enable the optional middleware as described above\n\n2. Add ``countries_plus.context_processors.add_request_country`` to your template TEMPLATE_CONTEXT_PROCESSORS setting (Django <1.8) or to your 'context_processors' option in the OPTIONS of a DjangoTemplates backend instead (Django 1.8)\n\n\nCompatibility\n-------------\nPython 2.7+ & 3.6+.\nDjango 1.11 and Django 2.0+ supported, however should still work on Django 1.4-1.10.\n\nNote: if you are using Django 1.7, tests will fail unless you are using Django 1.7.2 or higher due to a bug in earlier versions.\n\n\n\nIntegrating with django-languages-plus\n--------------------------------------\nIf you also have django-languages-plus(https://pypi.python.org/pypi/django-languages-plus) installed then you can run the following command once to associate the two datasets and generate a list of culture codes (pt_BR for example)::\n\n from languages_plus.utils import associate_countries_and_languages\n associate_countries_and_languages()\n\n\n\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n source /bin/activate\n (myenv) $ pip install tox\n (myenv) $ tox\n\nCredits\n-------\n\nTools used in rendering this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)\nand this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n## [1.2.1] - 2017-12-13\n### Fixed\n- Fixtures dir is now properly included in pip package\n\n## [1.2.0] - 2017-12-13\n### Added\n- Cleaned up project & improved documentation\n\n### Changed\n- Added tests for Django 2.0\n- Dropped tested support for Django versions < 1.11\n\n## [1.1.0] - 2016-03-14\n### Fixed\n- Fixed Geonames.org file format error\n\n## [1.0.1] - 2015-06-16\n### Added\n- Improved test coverage.\n\n### Changed\n- The Country model has had all fields with undefined lengths (ex: name) expanded to max_length=255. Defined length fields (ex: Iso, Iso3) are unchanged.\n- Two countries (Dominican Republic and Puerto Rico) have two phone number prefixes instead of 1. These prefixes are now comma separated.\n- The Country model will now validate on save and reject values of the wrong length. The test suite has been expanded to test this.\n\n### Fixed\n- Fixed update_countries_plus command for python 3\n\n## [1.0.0] - 2015-06-11\n### Added\n- Added feature to update data from geonames.org. \n- Test coverage has been substantially improved.\n\n### Changed\n- The data migration has been removed in favour of the new management command and manually loading the fixture.\n- The fixture is no longer named initial_data and so must be loaded manually, if desired.\n- In order to provide better compatibility with the way Django loads apps the Country model is no longer importable directly from countries_plus.\n- The get_country_by_request utility function has been moved into the Country model, and is available as Country.get_by_request(request)\n\n### Fixed \n- General code cleanup & improved test coverage.\n\n### Note\n- If you have been running an earlier version you should run python manage.py update_countries_plus to update your data tables as they may contain incorrect data.\n\n## [0.3.3] - 2015-01-27\n### Changed\n- Now uses Django 1.7 data migration pattern\n\n## [0.3.2] - 2015-01-10\n### Fixed\n- Corrected version number on setup.py\n\n## [0.3.1] - 2015-01-09\n### Added\n- Now compatible with Python 3 thanks to luiscberrocal\n\n## [0.3.0] - 2014-09-08\n### Added\n- Now compatible with Django 1.7 thanks to mrben\n\n## [0.2.0] - 2014-02-13\n### Added\n- Added middleware that adds the request country to the request object.\n\n## [0.1.5] - 2013-06-14\n### Fixed\n- Corrected model max_length attributes to properly match data.\n\n## [0.1.0] - 2013-05-22\n### Added\n- Initial release.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cordery/django-countries-plus", "keywords": "django-countries-plus", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-countries-plus", "package_url": "https://pypi.org/project/django-countries-plus/", "platform": "", "project_url": "https://pypi.org/project/django-countries-plus/", "project_urls": { "Homepage": "https://github.com/cordery/django-countries-plus" }, "release_url": "https://pypi.org/project/django-countries-plus/1.2.1/", "requires_dist": null, "requires_python": "", "summary": "A django model & fixture containing all data from the countries table of Geonames.org", "version": "1.2.1" }, "last_serial": 3415680, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "a93e11731de03a91c69a10c065409a3a", "sha256": "d76eabf4c8e9727ebd12eca3cc2b98cc41b704f17b362f43a1ec1fe1ea7eb211" }, "downloads": -1, "filename": "django-countries-plus-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a93e11731de03a91c69a10c065409a3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2673, "upload_time": "2013-05-22T21:30:05", "url": "https://files.pythonhosted.org/packages/94/9d/8f5831891f57267bd10f741132a407b50e74aabdf8826d1f155e2faef193/django-countries-plus-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ec948742ec403faa6be4337382a603a8", "sha256": "f0754dc9c0a7a70bf5cf20699180d9cc775b996c8676f8c9f0ccb2fd8bdb2ca9" }, "downloads": -1, "filename": "django-countries-plus-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ec948742ec403faa6be4337382a603a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2813, "upload_time": "2013-05-22T21:40:00", "url": "https://files.pythonhosted.org/packages/ce/14/6210af801f366c05cec69bc174a2b68ca19c1168ca5a9b97f80c07e5fce6/django-countries-plus-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "799ffbd99be844966442224d299f404a", "sha256": "47277a3f0104652b19edc426430c23b8946502a7f6f242e70f94e5ad5b85d7fc" }, "downloads": -1, "filename": "django-countries-plus-0.1.2.tar.gz", "has_sig": false, "md5_digest": "799ffbd99be844966442224d299f404a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23613, "upload_time": "2013-05-22T21:55:22", "url": "https://files.pythonhosted.org/packages/77/05/6f0a4e7c05c2b8e362dbcf2fe14a5a5481666e16677657fa506be9a44967/django-countries-plus-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "59ab5bd4f06deb037cef37a45474ab9b", "sha256": "d68a60d199bfcb919abcc9139ecd98be2503fca6713a5e7fa3a31914834c44a7" }, "downloads": -1, "filename": "django-countries-plus-0.1.3.tar.gz", "has_sig": false, "md5_digest": "59ab5bd4f06deb037cef37a45474ab9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23639, "upload_time": "2013-05-22T22:04:30", "url": "https://files.pythonhosted.org/packages/b3/cb/529bc68dc3b12bb6cd1df01ca51e851101bc69b1b197b42c68e091578d94/django-countries-plus-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "24eb9003fc840f4a1bec7fefb5427b5e", "sha256": "81a10652a7ea6cda42db3fc3d498b8a0de5c42bc1a90714c01bb5c188b9f6128" }, "downloads": -1, "filename": "django-countries-plus-0.1.4.tar.gz", "has_sig": false, "md5_digest": "24eb9003fc840f4a1bec7fefb5427b5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24438, "upload_time": "2013-05-22T22:29:48", "url": "https://files.pythonhosted.org/packages/20/15/d6bf31411eaae330d617af4c005b618e925fab8a2746304d6ddd638edc12/django-countries-plus-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "88376ec21d49fb510cac0cf5dc946729", "sha256": "fce4b2f09b4c6a57aebdc8e15db1deb5d4205122a9b17f1458ecae25775d790d" }, "downloads": -1, "filename": "django-countries-plus-0.1.5.tar.gz", "has_sig": false, "md5_digest": "88376ec21d49fb510cac0cf5dc946729", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24685, "upload_time": "2013-06-15T00:36:41", "url": "https://files.pythonhosted.org/packages/87/9b/f278a718b91a8d66cf17747d5ade2c01adc20e10d663077b7d62e814586c/django-countries-plus-0.1.5.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "10a14b57d09b4caffd8d574ef4a40020", "sha256": "28679914241be9a25f8c5cf82852a8d5767914144fb5f248379fd035653024df" }, "downloads": -1, "filename": "django-countries-plus-0.2.zip", "has_sig": false, "md5_digest": "10a14b57d09b4caffd8d574ef4a40020", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37925, "upload_time": "2014-05-23T12:24:39", "url": "https://files.pythonhosted.org/packages/66/6c/9265b3afa6350d15f0c080b4cf1bcee39b5849e27ce42090a2fbe041a427/django-countries-plus-0.2.zip" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2b96099ad35019aea67eb531e3db22b7", "sha256": "0b2cf242523bb0fa27db3b5a522bb432888db8f44f9fe0997e441a7d5fdac73e" }, "downloads": -1, "filename": "django-countries-plus-0.3.zip", "has_sig": false, "md5_digest": "2b96099ad35019aea67eb531e3db22b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38098, "upload_time": "2014-09-08T21:05:16", "url": "https://files.pythonhosted.org/packages/3f/f4/2fe6c1be4c714ec0e2b535b7bb2af920fec70445a15446f68844a18e49e4/django-countries-plus-0.3.zip" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "3c46d0ebdeddf87efb57b52e6d8a5aea", "sha256": "fd01c78ecabf961f5cd6a984ed9bc2c04929cab4bd7d3da90dfecdc21e9a5b28" }, "downloads": -1, "filename": "django-countries-plus-0.3.2.zip", "has_sig": false, "md5_digest": "3c46d0ebdeddf87efb57b52e6d8a5aea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41435, "upload_time": "2015-01-27T19:37:31", "url": "https://files.pythonhosted.org/packages/e1/18/bcd79d3386b259f2dbe41c78710ee4c188667922baf39c6b421ebfba9144/django-countries-plus-0.3.2.zip" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "4b7aaf98c25ca7ea6119e0a8f9028634", "sha256": "fdc979416e2230ca52f173b3bf00c168631dbe8f43b6fa39d2ddf8d72c3de8f3" }, "downloads": -1, "filename": "django-countries-plus-0.3.3.zip", "has_sig": false, "md5_digest": "4b7aaf98c25ca7ea6119e0a8f9028634", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41435, "upload_time": "2015-01-27T19:39:30", "url": "https://files.pythonhosted.org/packages/37/70/bda51065d9be5b8064d736027d847fd104e09338bab5fa6a3b41b670f048/django-countries-plus-0.3.3.zip" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "d50329e06a0b9681f09d1ac6b8bd9103", "sha256": "e8660eba366af51c20c2f47b35f5d43e2309dd667a14ee372ee0fbf2b2bacf32" }, "downloads": -1, "filename": "django-countries-plus-1.0.0.zip", "has_sig": false, "md5_digest": "d50329e06a0b9681f09d1ac6b8bd9103", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 72893, "upload_time": "2015-06-12T17:05:12", "url": "https://files.pythonhosted.org/packages/88/f7/7e078e0fea1d26b096721f4972587ac60b3774f2f35bb385c089cdd4c1a0/django-countries-plus-1.0.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "64402184523889e376f5d99e744928c7", "sha256": "383afa822595b6868ce2756af43b54c27b7c8ae3c80dd66ad9d940eb8704ba01" }, "downloads": -1, "filename": "django-countries-plus-1.0.1.zip", "has_sig": false, "md5_digest": "64402184523889e376f5d99e744928c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 80454, "upload_time": "2015-06-16T15:02:21", "url": "https://files.pythonhosted.org/packages/a9/d1/9f29ff97bdb1c25ec61e6ce6fe7dd57572269f3d8601b299892f24961e1a/django-countries-plus-1.0.1.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "6a3fd8ea556e85208de5225a60e635b5", "sha256": "4b141ddf35aa738f3d2bd9974cd41bd115cc5b0de80890836651049cc881b297" }, "downloads": -1, "filename": "django-countries-plus-1.1.tar.gz", "has_sig": false, "md5_digest": "6a3fd8ea556e85208de5225a60e635b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34660, "upload_time": "2016-03-14T12:10:39", "url": "https://files.pythonhosted.org/packages/ed/96/4a4f4742b1fefa67012524074ae859c5863fdc9a469cebab82040c0ef664/django-countries-plus-1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "ce8342ba334b9c8301112c3e110f400d", "sha256": "4c58cc98ca2fbfa8909058508f1b665f5eaddfd563c41b221e04c76be24d5658" }, "downloads": -1, "filename": "django_countries_plus-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce8342ba334b9c8301112c3e110f400d", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 17711, "upload_time": "2017-12-14T01:57:27", "url": "https://files.pythonhosted.org/packages/1f/4b/5c9df7ad2e4d93139d82eb332ba1a5d27b0fa32507ab1d35d5e85a1acfa0/django_countries_plus-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6a4fb2856da50368a4b4fec8b3062cd", "sha256": "a99dfebb432960945d45d45aa07a8de67aec5d82d88960ca653f2bd6c1b43972" }, "downloads": -1, "filename": "django-countries-plus-1.2.0.tar.gz", "has_sig": false, "md5_digest": "b6a4fb2856da50368a4b4fec8b3062cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14133, "upload_time": "2017-12-14T01:57:25", "url": "https://files.pythonhosted.org/packages/d6/cb/f5858b46204a285e4579f7f74b98702dbda9e4206d86726c36340df1948d/django-countries-plus-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "a80a5d2ac89cc333444b1eb7dc1c4f40", "sha256": "3bb42a8c2e092e43e56e8f422875bc372662af8243b5bfd7398fae92fdc7d338" }, "downloads": -1, "filename": "django_countries_plus-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a80a5d2ac89cc333444b1eb7dc1c4f40", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 39416, "upload_time": "2017-12-14T03:51:39", "url": "https://files.pythonhosted.org/packages/5b/2e/68716c3562e00619d0665816d52e179e7cc288eb5f26a253bd6ae8cc9e41/django_countries_plus-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f284a54e130195f727f4107e8afaf07c", "sha256": "a2e406f2422b6da32d59e7f7fbfc284b57303b1c271cf24fbcb94892f45876bb" }, "downloads": -1, "filename": "django-countries-plus-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f284a54e130195f727f4107e8afaf07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37846, "upload_time": "2017-12-14T03:51:36", "url": "https://files.pythonhosted.org/packages/88/23/d70c7e07a86c2f556f650b8152444f9f1458ace252e0d5d804387355cf90/django-countries-plus-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a80a5d2ac89cc333444b1eb7dc1c4f40", "sha256": "3bb42a8c2e092e43e56e8f422875bc372662af8243b5bfd7398fae92fdc7d338" }, "downloads": -1, "filename": "django_countries_plus-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a80a5d2ac89cc333444b1eb7dc1c4f40", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 39416, "upload_time": "2017-12-14T03:51:39", "url": "https://files.pythonhosted.org/packages/5b/2e/68716c3562e00619d0665816d52e179e7cc288eb5f26a253bd6ae8cc9e41/django_countries_plus-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f284a54e130195f727f4107e8afaf07c", "sha256": "a2e406f2422b6da32d59e7f7fbfc284b57303b1c271cf24fbcb94892f45876bb" }, "downloads": -1, "filename": "django-countries-plus-1.2.1.tar.gz", "has_sig": false, "md5_digest": "f284a54e130195f727f4107e8afaf07c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37846, "upload_time": "2017-12-14T03:51:36", "url": "https://files.pythonhosted.org/packages/88/23/d70c7e07a86c2f556f650b8152444f9f1458ace252e0d5d804387355cf90/django-countries-plus-1.2.1.tar.gz" } ] }