Reputation: 370
When i added new field to my product model ,it returned error like this-> 'Database Error at "/admin/app/product/" column app_product.product_sold_time does not exist LINE 1: ...duct_buy", "app_product"."product_favorite_send"'
Upvotes: 0
Views: 252
Reputation: 12548
When you add a field to a model and not to the database, then that new field will have no existing column in the database. The new field will not just "magically" have a column appear in the existing database.
So now your have these options with Django 1.5:
./manage.py syncdb
again,Upvotes: 1
Reputation: 11
You added a new field to you product model, but you have not migrated your DataBase, that's why you get Database Error.
You can upgrade Django using command:
pip install --upgrade django
than you can use django-commands
python manage.py makemigrations
python manage.py migrate
If you do not want to upgrade Django, install South and follow it`s instructions. http://test-driven-django-development.readthedocs.org/en/v2.0/08-south.html
Upvotes: 1