I want to import the cities of USA and Canada in Django cities light, so I my settings.py file looks alike
CITIES_LIGHT_TRANSLATION_LANGUAGES = ['en']
CITIES_LIGHT_INCLUDE_COUNTRIES = ['CA','USA']
CITIES_LIGHT_INCLUDE_CITY_TYPES = ['PPL', 'PPLA', 'PPLA2', 'PPLA3', 'PPLA4', 'PPLC', 'PPLF', 'PPLG', 'PPLL', 'PPLR', 'PPLS', 'STLMT',]
After this :
python manage.py migrate cities_light
python manage.py manage cities_light
But after all this :
I just got the cities of Canada not USA
I again did the step but data still not dumps , Any suggestion?
如果您确实查看城市数据,您会看到美国的首字母缩写词是美国
CITIES_LIGHT_INCLUDE_COUNTRIES = ['CA','US']
You may need to specify:
CITIES_LIGHT_CITY_SOURCES = ['http://download.geonames.org/export/dump/cities5000.zip']
The configuration parameter CITIES_LIGHT_CITY_SOURCES, comes with the default value http://download.geonames.org/export/dump/cities15000.zip that has cities with a population over 15000, if you need to load cities with less population please use another source. For the list of available source please check here: http://download.geonames.org/export/dump/readme.txt
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.