执行命令python manage.py loaddata municipios_geo_2013_4674.json.bz2
或python manage.py loaddata municipios_geo_2013_4674.json
时出现以下错误。如何解决AttributeError
?
包裹和json在:https://github.com/znc-sistemas/django-municipios
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 69, in handle
self.loaddata(fixture_labels)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 109, in loaddata
self.load_label(fixture_label)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/management/commands/loaddata.py", line 175, in load_label
obj.save(using=self.using)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/core/serializers/base.py", line 205, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/base.py", line 837, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/base.py", line 904, in _save_table
forced_update)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/base.py", line 954, in _do_update
return filtered._update(values) > 0
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/query.py", line 664, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1191, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 863, in execute_sql
sql, params = self.as_sql()
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1157, in as_sql
val = field.get_db_prep_save(val, connection=self.connection)
File "/Users/lidiane/Developer/django/integra-fundaj/.myvenv/lib/python3.5/site-packages/django/contrib/gis/db/models/fields.py", line 182, in get_db_prep_save
return connection.ops.Adapter(self.get_prep_value(value))
AttributeError: Problem installing fixture '/Users/lidiane/Developer/django/integra-fundaj/municipios_geo_2013_4674.json': 'DatabaseOperations' object has no attribute 'Adapter'