When i run

    python migrate

on my django project, i gets the following error

    Traceback (most recent call last):
    File "", line 22, in <module>
    File "/home/hari/project/env/local/lib/python2.7/site-     packages/django/core/management/", line 363, in execute_from_command_line
    File "/home/hari/project/env/local/lib/python2.7/site-packages/django/core/management/", line 355, in execute
    File "/home/hari/project/env/local/lib/python2.7/site-packages/django/core/management/", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
    File "/home/hari/project/env/local/lib/python2.7/site-packages/django/core/management/", line 330, in execute
    output = self.handle(*args, **options)
    File "/home/hari/project/env/local/lib/python2.7/site-packages/django/core/management/commands/", line 86, in handle
    File "/home/hari/project/env/local/lib/python2.7/site-packages/django/db/migrations/", line 298, in check_consistent_history
    django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency account.0001_initial on database 'default'.

I have a user model like below

    class User(AbstractUser):
    place = models.CharField(max_length=64, null=True, blank=True)
    address = models.CharField(max_length=128, null=True, blank=True)

So how can i solve this?

Your django_migrations table in your database is the cause of inconsistency and deleting all the migrations just from local path won't work.

You have to truncate the django_migrations table from your database and then try applying the migrations again. It should work but if it does not then run makemigrations again and then migrate.

Note: don't forget to take a backup of your data.