The error message seems to indicate that there's a question_id
column in your project_question_text
table, however, the Question_Text
model doesn't contain any ForeignKey to Question
. My guess is that you used to have a field like question = models.ForeignKey(Question)
in your Question_Text
model and at some point you changed the model definition. Your database table still reflects the old schema while your models don't.
The easiest solution would be to remove any tables you have changed and run syncdb again. Another solution would be to use migrations (i.e. South).
A slightly off-topic side note, standard Python code style suggests using CamelCase without underscores for class names, which means a slightly better and more standard name for your Question_Text
model would be QuestionText
.