django error OperationalError at /admin/blog/post/

15.4k views Asked by At

i get this error in simple django programme run.. OperationalError at /admin/blog/post/ no such table: blog_post

4

There are 4 answers

0
rnevius On

You need to run migrations before you can do that operation. The necessary tables don't exist in your database (as described by the error).

1
doniyor On

if django version >=django 1.7

python manage.py makemigrations 
python manage.py migrate

else

python manage.py schemamigrations
python manage.py migrate 

so you need to migrate (map the model changes / new models into database tables) the changes so that your page works properly

0
ofahchouch On

Check for a typo in the name of your Model. If you change your model name after makemigration and migrate, then it doesn't work and find the correct model name anymore.

0
Sarfraz z On

delete the migrations folder in app and then do :

python manage.py makemigrations
python manage.py migrate
python manage.py migrate --run-syncdb

it worked for me