I dropped some table related to an app. and again tried the syncdb command
python manage.py syncdb
It shows error like
dja
This is linked to the migration data in the scripts inside the project not matching with the migration scripts in the database as far as I could tell. I solved this by the following steps :
__ini__
managed=True
$ ./manage.py makemigrations
$ ./manage.py migrate
This will create the migration scripts again and will apply it to your database.
For those that may still be having trouble (like me), try this out:
Comment out all the URL's in the main app's urls.py
Then go ahead and run migrations:
$ ./manage.py makemigrations
$ ./manage.py migrate
The problem was alleviated by removing the ()
's
solved_time = models.DateTimeField('solved time', default=timezone.now())
to
solved_time = models.DateTimeField('solved time', default=timezone.now)
I got this answer from reddit