Skip to main content

Provides a country field for Django models.

Project description

Django Countries

Django Countries Logo

PyPI version Build status

A Django application that provides country choices for use with forms, flag icons static files, and a country field for models.

Documentation

📚 Read the full documentation

Quick Start

Install:

pip install django-countries

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'django_countries',
]

Use in your models:

from django_countries.fields import CountryField

class Person(models.Model):
    country = CountryField()

Features

  • Country Field: Django model field with all ISO 3166-1 countries
  • Translated Names: Country names translated using Django's i18n system
  • Flag Icons: Static flag image files for all countries
  • REST Framework: Full Django REST Framework integration
  • GraphQL: Support for graphene-django
  • Multiple Selection: Support for multiple country selection

Support

  • Python: 3.10, 3.11, 3.12, 3.13, 3.14
  • Django: 4.2 (LTS), 5.2 (LTS), 6.0
  • Django REST Framework: 3.14+

Contributing

Contributions are welcome! See the Contributing Guide for details.

Translations

Country names are translated using Django's standard gettext and imported from our Transifex project.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_countries-9.0.0.tar.gz (614.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_countries-9.0.0-py3-none-any.whl (931.8 kB view details)

Uploaded Python 3

File details

Details for the file django_countries-9.0.0.tar.gz.

File metadata

  • Download URL: django_countries-9.0.0.tar.gz
  • Upload date:
  • Size: 614.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_countries-9.0.0.tar.gz
Algorithm Hash digest
SHA256 a993416af08a8a4e6e866d56b71c7ce92351c81a2543da213cd7899917567a42
MD5 546327a3d89cf641261d43000d7fc427
BLAKE2b-256 6ec11e8feb818164c3f23465c08cc3bc1cd7da7101506268a138a1b92ea40339

See more details on using hashes here.

File details

Details for the file django_countries-9.0.0-py3-none-any.whl.

File metadata

  • Download URL: django_countries-9.0.0-py3-none-any.whl
  • Upload date:
  • Size: 931.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_countries-9.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21fce461733c856355c487d1f24b71338599482505004a0c2e521fd574a59fb1
MD5 fa30e4b575a35322284bc93cdc2e1957
BLAKE2b-256 5cbb5a17b339852f6486d02b4dd0033132082976c71f049ee909ccb42917be52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page