coderholic / django-cities

Countries and cities of the world for Django projects
MIT License
923 stars 371 forks source link

Import not working #98

Closed cdvv7788 closed 9 years ago

cdvv7788 commented 9 years ago

I am running python manage.py --import=all It takes it like 5 seconds to stop. Nothing gets imported. Am i doing something wrong?

coderholic commented 9 years ago

Are you running ./manage.py cities --import=all?

cdvv7788 commented 9 years ago

Just copy/pasted that, same outcome.

coderholic commented 9 years ago

Copy the logging settings from https://github.com/coderholic/django-cities/blob/master/example/settings.py and then report back what the logs say

cdvv7788 commented 9 years ago

INFO File up-to-date: countryInfo.txt INFO File up-to-date: admin1CodesASCII.txt INFO File up-to-date: admin2Codes.txt INFO File up-to-date: cities5000.zip INFO File up-to-date: cities5000.zip INFO File up-to-date: alternateNames.zip INFO File up-to-date: allCountries.zip

From what i remember (used this in the past) that command should extract and dump that data to my db, right?

cdvv7788 commented 9 years ago

It inserted the data. I manually deleted those files from the package (site-packages/cities/data/*). It seems to be comparing server files with local files and ignoring update if they are equal. Maybe i imported that in the past and is using a cached version of the package, which contains that data (is unlikely but can't discard). Are you able to reproduce the issue or is it just me? I am using python3.4. What about providing some mechanism to improve that verification? We could add some table to keep track of last import. That would fail too if tables are manually deleted, but would be more reliable than current method.

coderholic commented 9 years ago

--force forces the import

cdvv7788 commented 9 years ago

Oh true, dumb me. thanks.

debuggerpk commented 9 years ago

do you mean

./manage.py cities --import=all --force

to force import?

//ysf

cdvv7788 commented 9 years ago

Yeah, thats the whole command

debuggerpk commented 9 years ago

thanks