When I run the project and log into the admin site, all works fine.
While creating a new ReleaseImageGallery, I try to add a new Release object (FK relationship) via a select list, an error is raised in the add_view as follows:
```
Environment:
Request Method: GET
Request URL:
http://127.0.0.1:8000/admin/releases/release/add/?_to_field=id&_popup=1Django Version: 3.2.5
Python Version: 3.9.6
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'tinymce',
'nested_inline',
'coresite.apps.CoreSiteConfig',
'customadminoptions.apps.CustomAdminOptionsConfig',
'baseimagegalleries.apps.BaseImageGalleriesConfig',
'baseusers.apps.UsersConfig',
'userprofiles.apps.UserProfilesConfig',
'artists.apps.ArtistsConfig',
'artistimagegalleries.apps.ArtistImageGalleriesConfig',
'bands.apps.BandsConfig',
'labels.apps.LabelsConfig',
'releaseimagegalleries.apps.ReleaseImageGalleriesConfig',
'releases.apps.ReleasesConfig']
Installed Middleware:
('whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback (most recent call last):
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/db/models/options.py", line 608, in get_field
return self.fields_map[field_name]
During handling of the above exception ('_to_field'), another exception occurred:
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/nested_inline/admin.py", line 217, in add_view
f = opts.get_field(k)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/db/models/options.py", line 610, in get_field
raise FieldDoesNotExist("%s has no field named '%s'" % (self.object_name, field_name))
During handling of the above exception (Release has no field named '_to_field'), another exception occurred:
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/contrib/admin/options.py", line 616, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/contrib/admin/sites.py", line 232, in inner
return view(request, *args, **kwargs)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/utils/decorators.py", line 43, in _wrapper
return bound_method(*args, **kwargs)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/Users/sd/Library/Caches/pypoetry/virtualenvs/afridisc-sWjK8x-o-py3.9/lib/python3.9/site-packages/nested_inline/admin.py", line 218, in add_view
except models.FieldDoesNotExist:
Exception Type: AttributeError at /admin/releases/release/add/
Exception Value: module 'django.db.models' has no attribute 'FieldDoesNotExist'
I have checked the class definitions and do not understand the breakage. What am I missing?
TIA.