ValueError: The field form.Form.ticket_description was declared with a lazy reference to 'tickets.ticketdescription', but app 'tickets' doesn't provide model 'ticketdescription'.
Traceback (most recent call last):
File "manage.py", line 23, in <module>
execute_from_command_line(sys.argv)
File "[...]/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "[...]/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "[...]/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "[...]/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "[...]/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "[...]/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 234, in handle
fake_initial=fake_initial,
File "[...]/lib/python3.6/site-packages/django/db/migrations/executor.py", line 121, in migrate
state = self._migrate_all_backwards(plan, full_plan, fake=fake)
File "[...]/lib/python3.6/site-packages/django/db/migrations/executor.py", line 173, in _migrate_all_backwards
for migration, _ in full_plan:
File "[...]/lib/python3.6/site-packages/django/utils/functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "[...]/lib/python3.6/site-packages/django/db/migrations/state.py", line 210, in apps
return StateApps(self.real_apps, self.models)
File "[...]/lib/python3.6/site-packages/django/db/migrations/state.py", line 280, in __init__
raise ValueError("\n".join(error.msg for error in errors))
ValueError: The field form.Form.ticket_description was declared with a lazy reference to 'tickets.ticketdescription', but app 'tickets' doesn't provide model 'ticketdescription'.
Adrien,
Your precise issue eludes me, but I have sometimes come across a similar issue when changing the field types of models.
It appears that you still have a reference somewhere in your code between the form and the model. I suspect that form.Form.ticket_description is a Django default expected file name from one of your (original) CBV’s.
Alternative:
My method to resolve the Catch22 is to delete the most recent migration files, including in your case, the migration file that originally created the ‘ticketdescription’ model. I move them to a dummy folder, in case they shouldn’t have been deleted.
Bruckner de Villiers
083 625 1086
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4f876052-71e5-4d25-9382-59d3c30d19f8%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.