It seems the origin_id column in the flights_flight table references the primary key of the flights_airport table. The value 'New York' in flights_flight.origin_id does not correspond to any valid id in the flights_airport table. So, ensure your foreign key relationship code in your modles.py, or check your data in your flights_flight table, maybe delete the row where flights_flight.origin_id = 'New York'