Django admin page gives KeyError

I have a model as in the following

class TestModel(models.Model):
    ...
    product = models.ForeignKey(...)
    vendor = models.ForeignKey(...)
    ...

The problem is when I go to django admin change page
testmodel/3/change.
It gives me errors.
Sentry gives me more details and it says KeyError: 'product' or sometimes KeyError: 'vendor'
How can I figure out what causes this issue?

If you’re running this from a shell using runserver (or runserver_plus), that screen should give you the full traceback of the error.

Unfortunately, it only happens on production

If you’ve got logging configured, then it should be in the server logs. If you’ve got the email notifications configured, you should have received an email with the traceback.