I'm using django-cities-light (lighter version of django-cities) with Django 1.8.x. It defines the abstract models of Country, Region/State and City, so that we can extend and add custom fields. For example, we can add timezone to city by writing a post_import signal handler as explained here.
Likewise I need to add the field capital
to each country. I'm not much familiar in GeoDjango and I knew that django-cities
app's Country has the capital field.
You need to setup a custom Country model. Lets say you have an app 'mygeonames' with models.py:
Then in settings.py you should specify
CITIES_LIGHT_APP_NAME = 'mygeonames'
, and put both apps 'cities_light' and 'mygeonames' toINSTALLED_APPS
After that you can migrate your DB and run
./manage.py cities_light
At the end you should get something like this:
But you might want to link with Cities table instead.