Nice little application for Django projects providing fixtures and models for a "complete" list of world countries and US states. Also throwing in a small template filter for getting country flags by ISO 3166-1 alpha-2 country code.
Installation
Just check out the latest source and copy countries into your django site directory:
svn checkout http://
add countries to the list of installed apps and run syncdb and you're good to go. (Note: the models are fixed to the country and usstate tables, se models.py for details)
And for the flags hed over to famfamfam and download the ISO 3166-1 alpha-2 country code flag package. And add a flags director to your media root and copy the .gif flags there. An alternative flag resource is ip2location
Optionally add:
COUNTRIES_FLAG_PATH = '<path relative to media root>flags/%s.png'
to django settings if you want to have the flags in an alternative location or use .png instead of the default .gif ( .gif is just a tiny bit smaller ;)
Source of information
Country list
The list of world countries is based on the list of ISO 3166 codes for countries in existence at the time of last update. The tricky part is getting the list complete with iso-2 code, iso-3 code, number and official printable name se models.py for more details. Therefore this country list is a merge from these two resources:
* http://
* http://
The official list is constantly receiving updates, so the list might not be 100% accurate.
Country list last updated: 2007-08-20 - 244 countries.
US States list
* DEPRECATED django.
US states list is a plain list of name and abbreviation. Making the list more complete are the additional six military "states" all according to the usps list at the time of last update:
* http://
US States list last updated: 2007-08-20 - 59+6=65 states
Disclaimer
As a disclaimer I'll cite the Unite Nations list of county names at http://
"The designations employed and the presentation of country or area names in this list do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations author concerning the legal status of any country, territory, city or area or of its authorities, or concerning the delimitation of its frontiers or boundaries."
Project information
- Maintainer:
- Joshua Blount
- Driver:
- Not yet selected
- Licence:
- Simplified BSD Licence
View full history Series and milestones
trunk series is the current focus of development.
All code Code
- Version control system:
- Bazaar
- Programming languages:
- python
All packages Packages in Distributions
-
django-countries source package in Xenial
Version 3.4.1-2ubuntu1 uploaded -
django-countries source package in Trusty
Version 1.5-1 uploaded -
django-countries source package in Precise
Version 1.1.1-1 uploaded -
django-countries source package in Mantic
Version 7.3.2-1 uploaded -
django-countries source package in Lunar
Version 7.3.2-1 uploaded