Error when importing all data
tagmetag opened this issue · 2 comments
tagmetag commented
Hello,
I got this error when importing data:
File "C:\Users\User\Desktop\FeedGit\backend\cities\management\commands\cities.py", line 274, in import_country
'continent': continents[item['continent']] if import_continents_as_fks else item['continent'],
KeyError: u'EU'
I set up all path in settings.py:
CITIES_DATA_DIR = '/var/data'
CITIES_FILES = {
'country': {
'filename': 'countryInfo.txt',
'urls': [url_base + '{filename}', ],
},
'region': {
'filename': 'admin1CodesASCII.txt',
'urls': [url_base + '{filename}', ],
},
'subregion': {
'filename': 'admin2Codes.txt',
'urls': [url_base + '{filename}', ],
},
'city': {
'filename': 'cities1000.txt',
'urls': [url_base + '{filename}', ],
},
'hierarchy': {
'filename': 'hierarchy.txt',
'urls': [url_base + '{filename}', ],
},
'alt_name': {
'filename': 'alternateNames.txt',
'urls': [url_base + '{filename}', ],
},
'postal_code': {
'filename': 'allCountries.txt',
'urls': [url_base + '{filename}', ],
}
}
CITIES_LOCALES = ['en', 'und', 'link']
This issue because when I migrate cities, it doesn;t create data about Continents. I dont know the reason
Please help me!
rushil02 commented
Hey, I encountered the exact same error, but I'm not using any customized file settings. Why is this happening and what is the way around this?