Django works well, except when you try to do migrations. Then you are in hell. I just added 2 fields to a model and bingo. Since I had already bad experience with migrations I already started afresh and removed all previous migrations. No advance. So the final error on which I’m completely stuck because Django gives no clue what is wrong in which of my files. So apparently I’m not experienced enough to understand what is happening and where. From my previous experience I already expected problems with a model of which the fk’s are replaced by something else, so I wisely decided to rename that model. So that shouldn’t cause any trouble. But… the error I get hints to something wrong with a fk. So here is the error:
Traceback (most recent call last):
File "/mnt/nvme_ssd/Aussie_projects/manage.py", line 22, in <module>
main()
File "/mnt/nvme_ssd/Aussie_projects/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/eddys/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/home/eddys/.local/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/eddys/.local/lib/python3.11/site-packages/django/core/management/base.py", line 416, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/eddys/.local/lib/python3.11/site-packages/django/core/management/base.py", line 457, in execute
self.check(**check_kwargs)
File "/home/eddys/.local/lib/python3.11/site-packages/django/core/management/base.py", line 492, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/core/checks/registry.py", line 89, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 52, in check_admin_app
errors.extend(site.check(app_configs))
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/sites.py", line 90, in check
errors.extend(modeladmin.check())
^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/options.py", line 151, in check
return self.checks_class().check(self, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 809, in check
*self._check_inlines(admin_obj),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 846, in _check_inlines
return list(
^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 848, in <genexpr>
self._check_inlines_item(obj, item, "inlines[%d]" % index)
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 889, in _check_inlines_item
return inline(obj.model, obj.admin_site).check()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/options.py", line 151, in check
return self.checks_class().check(self, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 1245, in check
*self._check_relation(inline_obj, parent_model),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/eddys/.local/lib/python3.11/site-packages/django/contrib/admin/checks.py", line 1286, in _check_relation
_get_foreign_key(parent_model, obj.model, fk_name=obj.fk_name)
File "/home/eddys/.local/lib/python3.11/site-packages/django/forms/models.py", line 1245, in _get_foreign_key
fks_to_parent = [
^
File "/home/eddys/.local/lib/python3.11/site-packages/django/forms/models.py", line 1253, in <listcomp>
f.remote_field.model._meta.proxy
^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute '_meta'
I reviewed all my fk’s but I don’t see anything wrong.
I appreciate some light in this darkness.