Skip to main content

Provides a country field for Django models.

Reason this release was yanked:

Inadvertently dropped Python 3.7 support without a major version bump. Use 8.0.0 or later instead.

Project description

Django Countries

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.8, 3.9, 3.10, 3.11, 3.12, 3.13
  • Django: 3.2 (LTS), 4.2 (LTS), 5.0, 5.1
  • Django REST Framework: 3.11+

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-7.8.tar.gz (551.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-7.8-py3-none-any.whl (896.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_countries-7.8.tar.gz
  • Upload date:
  • Size: 551.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for django_countries-7.8.tar.gz
Algorithm Hash digest
SHA256 b8413065160bc93efe1293d746bbde32951d9a1fe7e44f1fe2add1bebbb6962f
MD5 ff4b96f6200e7f4d7ce10125c370a9d8
BLAKE2b-256 06ac3b4ce340bedf96743f403542acfe7f66667954f5f0b2bed7aa4ade7ddaa8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_countries-7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6a9cc056f22f160b8f4df6fb11583208d503a8407af1ef7a51985f8ff1a13b34
MD5 f2b5a2cb61bb5fb3214c3a6a39c2ee8d
BLAKE2b-256 1f6998ad5bd078c6447e252d915a54e6b4d8909e793e6c8dfaf3e91172c9280c

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