Assuming that you have added image
after you have done ./manage.py syncdb
. Then either delete the database and syncdb again (not prefered). Or add Django South for data migration (prefered).
How to work with south? When you have added south in your project. Remove the image
field first so that your model looks exactly same as it was before. Then perform these steps:
- python manage.py convert_to_south myapp.blog
- python manage.py migrate myapp.blog 0001 --fake
Now add image
field back to your Post
model and perform these steps:
- python manage.py schemamigration myapp.blog --auto
- python manage.py migrate myapp.blog