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.8, 3.9, 3.10, 3.11, 3.12, 3.13
  • Django: 3.2 (LTS), 4.2 (LTS), 5.0, 5.1, 5.2
  • 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-8.0.1.tar.gz (567.0 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-8.0.1-py3-none-any.whl (906.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django_countries-8.0.1.tar.gz
Algorithm Hash digest
SHA256 ebe7a14b0837f23cef76665ef327be5b661f080c2b6fd1957dc49f501b0c9fef
MD5 9920e6d7689611a3a21de49cc2f84605
BLAKE2b-256 111adcbc6f196e601b85fd31df6c3d4700924b89a046cb899b3c708c996b8e25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_countries-8.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b5572e1e04bd7d97681c73801b452803a2e2a0e00de3ecaa7a9d6bfa4cf2110
MD5 83b99d40938ae3933885edbdde85d1df
BLAKE2b-256 bd1cab2e105a4a42bdce9d30e816c389d4d61582fd19f7c7f1d7a410530ee08c

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