Skip to content Skip to sidebar Skip to footer

Django Tutorial01 Operationalerror: No Such Column: Polls_choice.question_text_id

I was new to Python and Django and followed 'django / docs / intro / tutorial01.txt' step by step. At first, everything went well until I went to line 765. I tried to debug, but

Solution 1:

There are two possibilities that to get this error 1) You added extra field to model after doing the syncdb. 2) you added new class to model.py file in django.

Solution for this is:

First install south by using command

forwindows: **easy_install south**     //for that you need to go to the script folder of python folder in c drive.forlinux: **sudo easy_install south**  

Then follow the steps which are included here migration tutorials

step1- python manage.py schemamigration your_app_name --initial

step-2 python manage.py migrate your_app_name

if you made any changes in model then

1) python manage.py schemamigration your_app_name --auto2) python manage.py migrate your_app_name

Hope this will help you.

Solution 2:

Make sure you are following the correct tutorial for the version of Django that you are using. You have linked to the docs in the master branch, which will eventually become Django 1.7. If you are using Django 1.6, then use the 1.6 tutorial.

I recommend you start the tutorial again, using the correct docs. It will be quicker the second time through. If you get stuck again, then please update your question. Good luck!

Post a Comment for "Django Tutorial01 Operationalerror: No Such Column: Polls_choice.question_text_id"