[Answer]-Table UserAndPlace_userprofile has no column named gender

1👍

syncdb will not create or modify columns if they already exist in the database. If you already had the model and then you added the gender column, running syncdb will not do anything.

You need to drop the table and re-create it again. If you are using sqlite, simply delete the database file and run syncdb.

If you are using another database, run manage.py sqlclear yourapp and this will give you the SQL you need to execute to reset the tables for the app yourapp (make sure you replace yourapp with the name of the application that has the profile model).

Then, run syncdb again to recreate your models.

0👍

Have you done a python manage.py syncdb after you made any changes to your model? This error usually happens when the model and the database are out of sync.

Leave a comment