coderholic / django-cities

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

Not adding data to DB #122

Closed ianvieira closed 7 years ago

ianvieira commented 8 years ago

I'm using Python 3, Postgres with GIS and Django 1.9, but everytime I run ./manage.py cities --import=all --force no data is added to the database. The progressbars run normally, but when I try to look for the data on the database, there is none. Does the data is saved in another DB first then transferred in the end to another? I tried to run it a few times and I don't have even a country on the DB.

PS: the migrations are running ok.

ianvieira commented 8 years ago

Only add to the DB if all the inserts are successful, in case of restarting the injection, it don't commit partially. Using cities1000 instead allCountries, worked.

blag commented 8 years ago

Is there anything to do on this issue or did you figure this out?

ianvieira commented 8 years ago

On the new version it's working. I'm just having some problems with Python 3 and Django 1.10 in command line, I fixed it in https://github.com/UrbShip/django-cities but it's not ready to do a PR. I'll work more on this and create a PR.

blag commented 8 years ago

Cool, thank you for your help! 😄

blag commented 7 years ago

I'm going to close this issue, but feel free to reopen if you have the issue again. I think the changes in your fork were superseded by recent commits, so feel free to try out the master branch and (for now) the more-tests branch.

blag commented 7 years ago

I just pushed version 0.5 out to PyPI and it fixes a bunch of issues, implements slugs and allows a custom slugify() function, documents all migrations and import options in the README, and adds a bunch of tests. It should support Django 1.10 and 1.11 completely.

You should be able to install/upgrade using pip:

pip install --upgrade django-cities

and then run migrations and the import script.