django-cities icon indicating copy to clipboard operation
django-cities copied to clipboard

Restricting import?

Open timmyomahony opened this issue 7 years ago • 2 comments
trafficstars

I'm confused by the import configuration settings and general workflow.

  • Can I supply the files to be imported into the DB myself (by downloading manually and placing in the correct data folder), in other words can I skip the "download" stage of the import command
  • Can I restrict what countries, cities etc. are imported? For example, I only want US cities to be imported.

Thanks

timmyomahony avatar Jun 28 '18 11:06 timmyomahony

I'm confused by the import configuration settings and general workflow.

  • Can I supply the files to be imported into the DB myself (by downloading manually and placing in the correct data folder), in other words can I skip the "download" stage of the import command
  • Can I restrict what countries, cities etc. are imported? For example, I only want US cities to be imported.

Thanks

I don't know about 1 point. About 2: https://github.com/coderholic/django-cities#download-files You can see whole list here: http://download.geonames.org/export/dump/

CITIES_FILES = {
     'city': {
        'filenames': ["US.zip"],
        'urls':      ['http://download.geonames.org/export/dump/'+'{filename}']
    },
}

fffffrolov avatar Jul 08 '19 13:07 fffffrolov

What about the regions / postal codes? There is no way to filter for these models

ddahan avatar Aug 17 '22 23:08 ddahan