coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
913 stars 377 forks source link

Restricting import? #200

Open timmyomahony opened 6 years ago

timmyomahony commented 6 years ago

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

Thanks

fffffrolov commented 5 years ago

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}']
    },
}
ddahan commented 1 year ago

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