Registry / database / django-cities-light

django-cities-light

JSON →
library3.11.0pypypiunverified

A simple Django app to retrieve country, region, and city data with autocomplete support and database migrations. Current version 3.11, released with periodic updates.

pip install django-cities-light
INSTALL
IMPORT
SIG · DJANGO-CITIES-LIGH
D
django-cities-light
databasepythonv3.11.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Country
from cities_light.models import Country
from cities_light.models import Country
Region
from cities_light.models import Region
City
from cities_light.models import City

Add 'cities_light' to INSTALLED_APPS, run migrate, then load data with management command.

INSTALLED_APPS = [ ... 'cities_light', ] # Run migrations and load data # python manage.py migrate # python manage.py cities_light
Debug
Known issues
breakingData tables (Country, Region, City) are not loaded automatically after migration; you must run the management command 'cities_light' to populate them. Missing this step causes empty dropdowns.
fix
Run: python manage.py cities_light
affects: all
gotchaThe 'continent' field on Country is not populated by default; you need to set CITIES_LIGHT_LOAD_CONTINENT = True in settings before running the management command.
fix
Add CITIES_LIGHT_LOAD_CONTINENT = True to settings.py
affects: >=3.0
deprecatedThe old 'autocomplete_light' widget (from django-autocomplete-light) is deprecated in favor of the native autocomplete fields. Users should migrate to using Django's built-in autocomplete or the newer patterns.
fix
Use django-autocomplete-light or django-select2 with a custom view wrapping the cities_light models.
affects: >=3.5
Upgrade
Version history
3.11.0latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
django-cities-light — pip install django-cities-light · libregistry