Django: Country drop down list?
Check out "choices" parameter of a CharField.
You might also want to take a look at django-countries.
from django_countries.fields import CountryFieldclass Foo(models.Model): country = CountryField()
Ended up using the below snippet which basically defines a tuple of tuples of two character country codes. Additionally it defines a custom field type called CountryField and defaults the choices parameter to the above defined tuple. This automatically gets rendered as a drop down list.