skillfed

django-localflavor

Country-specific Django helpers

django-localflavor v5.1 1.0M downloads/30d#4,473 on PyPI922
Permissive license BSD-3-Clause Active released

What it is and what it does

django-localflavor is a standalone Django package that provides localized form fields and validators for specific countries and regions. It was originally part of Django's core but was separated to keep the framework lean. The package includes postal code validators, government ID number fields, and other country-specific helpers that integrate seamlessly with Django's form system.

The package depends on Django and python-stdnum for validation logic. It actively supports modern Django versions (4.2 through 6.0) and Python 3.9+. The project is actively maintained with recent releases and regular commits, making it suitable for production use in applications that need localized form handling.

Use it for:

  • Validate postal codes in a user registration form for a specific country
  • Build a Django form with country-specific government ID number fields for compliance
  • Localize form validation rules across a multi-country web application
  • Add region-specific address or tax ID validation to checkout flows

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides country-specific form fields, validators, and helpers for Django applications, such as postal code formats and government ID number validation tailored to individual countries.

Yes. The package is actively maintained, has low install friction, carries a permissive license, and solves a real problem for Django applications serving specific countries. Install it when you need country-specific form validation; skip it if your application is country-agnostic or uses a custom validation layer.

Install

django-localflavor on PyPI

pip

pip install django-localflavor

uv

uv add django-localflavor

poetry

poetry add django-localflavor

Installing django-localflavor

Before you install

Low install friction with a pure Python wheel. Actively maintained with a recent release (13 days old) and steady commits. Requires Django and python-stdnum as runtime dependencies.

License in practice

BSD-3-Clause permissive license allows use in commercial and private projects with minimal restrictions; attribution required.

Quickstart

pip install django-localflavor

from django_localflavor.us.forms import USStateField

field = USStateField()

Requires Django 4.2, 5.0, 5.1, 5.2, or 6.0; Python 3.9 or later.

Verify before relying

  • Which specific countries or regions are currently supported by version 5.1
  • Whether breaking data changes in version 5.1 affect existing deployments beyond LV, NP, NO flavors mentioned

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — django, python-stdnum
Maintenance actively maintained — 13 days since the last release
Last repo commit
First released
Downloads 1,029,601/month — #4,473 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_localflavor-5.1-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP

Tags

django country-specific form fieldspostal code validation by countrydjango localflavorgovernment id validation djangocountry-specific django helpersdjango localized form validatorsregional django form fields
django-formslocalizationvalidation

More WWW/HTTP packages