python manage.py loaddata --settings definme.settings.dev django-dump.json
wagtail.models.i18n.Locale.DoesNotExist: Problem installing fixture Locale matching query does not exist.
CodePudding user response:
Unfortunately that isn't enough information to help you. The error message is saying you are missing some locale information. For anyone here to help you we need to know how you created your django-dump.json
file and the status of the database you are importing into.
CodePudding user response:
Traceback (most recent call last):
File "/Users/noro/Documents/Ongrid/definme/definme/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 102, in handle
self.loaddata(fixture_labels)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 163, in loaddata
self.load_label(fixture_label)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 253, in load_label
if self.save_obj(obj):
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 209, in save_obj
obj.save(using=self.using)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/serializers/base.py", line 281, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/base.py", line 841, in save_base
pre_save.send(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in
(receiver, receiver(signal=self, sender=sender, **named))
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 368, in set_locale_on_new_instance
instance.locale = Locale.get_default()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 61, in get_default
return cls.objects.get_for_language(settings.LANGUAGE_CODE)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 34, in get_for_language
return self.get(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/query.py", line 496, in get
raise self.model.DoesNotExist(
wagtail.models.i18n.Locale.DoesNotExist: Problem installing fixture '/Users/noro/Documents/Ongrid/definme/django-dump.json': Locale matching query does not exist.
(venv) noro@Norayrs-MacBook-Air definme % python definme/manage.py loaddata django-dump.json
Traceback (most recent call last):
File "/Users/noro/Documents/Ongrid/definme/definme/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 102, in handle
self.loaddata(fixture_labels)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 163, in loaddata
self.load_label(fixture_label)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 253, in load_label
if self.save_obj(obj):
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/management/commands/loaddata.py", line 209, in save_obj
obj.save(using=self.using)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/core/serializers/base.py", line 281, in save
models.Model.save_base(self.object, using=using, raw=True, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/base.py", line 841, in save_base
pre_save.send(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 176, in send
return [
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/dispatch/dispatcher.py", line 177, in
(receiver, receiver(signal=self, sender=sender, **named))
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 368, in set_locale_on_new_instance
instance.locale = Locale.get_default()
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 61, in get_default
return cls.objects.get_for_language(settings.LANGUAGE_CODE)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/wagtail/models/i18n.py", line 34, in get_for_language
return self.get(
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/Users/noro/Documents/Ongrid/definme/venv/lib/python3.10/site-packages/django/db/models/query.py", line 496, in get
raise self.model.DoesNotExist(
wagtail.models.i18n.Locale.DoesNotExist: Problem installing fixture '/Users/noro/Documents/Ongrid/definme/django-dump.json': Locale matching query does not exist.