OperationalError, no such column. Django

后端 未结 22 1877
情话喂你
情话喂你 2020-12-24 00:45

I am very new to django and was able to finish the tutorial on djangoproject.com without any errors. I am now going through the Django REST framework tutorial found at http:

22条回答
  •  青春惊慌失措
    2020-12-24 01:17

    Let's focus on the error:

    Exception Value: no such column: snippets_snippet.owner_id

    Let's see if that's true...

    You can use the manage.py command to access your db shell (this will use the settings.py variables, so you're sure to connect to the right one).

    manage.py dbshell

    You can now show the details of your table by typing:

    .schema TABLE_NAME

    Or in your case:

    .schema snippets_snippet

    More sqlite commands can be found here or by issuing a:

    .help

    Lastly, end your session by typing:

    .quit

    This doesn't get you out of the woods, but it helps you know what end of the problem to work on :)

    Good luck!

提交回复
热议问题