[Answered ]-OperationalError: (1054, "Unknown column 'example.example_field' in 'field list'")

2πŸ‘

βœ…

In either circumstance (AWS or local branch), the first step is to make sure that your updated code is, in fact, deployed on the instance properly.

  1. Navigate to to your project

    cd /path/to/django/project
    
  2. Check the Example class definition in the file:

    grep -A20 'class Example\(' models.py
    
  3. Verify that your field has, in fact, been removed from the code on both instances or your local branch.

  4. Do a global search in your project for use of example_field:

    cd /path/to/django/project
    find . -name '*.py' | xargs grep -Ri example_field 
    
  5. Remove all pyc files and restart your app server:

    cd /path/to/django/project
    find . -name '*.pyc' -delete
    
πŸ‘€2ps

Leave a comment