django-countryware

A Django utility application that provides translated country name services


License
MIT
Install
pip install django-countryware==1.0.0

Documentation

Django Countryware

A Django application to provides translated country names

status-image version-image coverage-image

Overview

Best attempt to translate country names while keeping it DRY.

How to install

1. easy_install django-countryware
2. pip install django-countryware
3. git clone http://github.com/un33k/django-countryware
    a. cd django-countryware
    b. run python setup.py install
4. wget https://github.com/un33k/django-countryware/zipball/master
    a. unzip the downloaded file
    b. cd into django-countryware-* directory
    c. run python setup.py install

How to use

 # In a models.py
 from countryware.utils.country import get_all_countries_prioritized
 from countryware.fields import CountryField

 country = CountryField(
     _("Country"),
     choices=get_all_countries_prioritized(),
 )

Advanced users:

 # In a settings.py
 # You can overwrite the default list of country codes
 ALL_COUNTRY_CODES = ['US', 'CA', 'MX', 'FR']

 # You can prepend priority countries to the lst
 PRIORITY_COUNTRY_CODES = ['US', 'CA']

Running the tests

To run the tests against the current environment:

python manage.py test

License

Released under a (MIT) license.

Version

X.Y.Z Version

`MAJOR` version -- when you make incompatible API changes,
`MINOR` version -- when you add functionality in a backwards-compatible manner, and
`PATCH` version -- when you make backwards-compatible bug fixes.