I am going through the GeoDjango tutorial from the official documentation.
- I have installed the required geospatial libraries, installed and enabled spatial functionality by extending the PostgreSQL via postgis.
- Downloaded the world borders data, and have unzipped the data.
- Created a GeoDjango model (WorldBorder) in the world app.
- Created the load.py inside the world app, as instructed in the documentation.
But when I try to import the load module and call the run routine, I am getting an error:
Failed to save the feature (id: 141) into the model with the keyword arguments:
Traceback (most recent call last):
File "/home/vagrant/.virtualenvs/testenv/lib/python3.6/site-packages/django/contrib/gis/utils/layermapping.py", line 577, in _save
stream.write('%s: %s\n' % ('Updated' if is_update else 'Saved', m))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/vagrant/geo_project/world/load.py", line 30, in run
lm.save(strict=True, verbose=verbose)
File "/home/vagrant/.virtualenvs/testenv/lib/python3.6/site-packages/django/contrib/gis/utils/layermapping.py", line 627, in save
_save()
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/home/vagrant/.virtualenvs/testenv/lib/python3.6/site-packages/django/contrib/gis/utils/layermapping.py", line 586, in _save
stream.write('%s\n' % kwargs)
UnicodeEncodeError: 'ascii' codec can't encode character '\xc3' in position 62: ordinal not in range(128)
I cannot figure out where I am wrong. Could you please help me out? Thank you.