dragon-fire-fly / developer_matcher

2 stars 1 forks source link

[BUG] InconsistentMigrationHistory Error #14

Closed dragon-fire-fly closed 1 year ago

dragon-fire-fly commented 1 year ago

Describe the bug The server runs successfully, but I am unable to create a superuser to access the admin panel. The error states django.db.migrations.exceptions.InconsistentMigrationHistory: migration admin.0001_initial is applied before its dependency app_home.0001_initial on database 'default'

To Reproduce Steps to reproduce the behavior:

  1. Go to terminal
  2. Type python manage.py migrate
  3. See error

Expected behavior The terminal should have prompted choice of username, email and password for use in the admin panel.

Screenshots InconsistentMigrationHistory

Desktop (please complete the following information):

Additional context Seems to be a problem with migration order - some tables may have been migrated before other, dependent tables.

dragon-fire-fly commented 1 year ago

This was solved by commenting out 'django.contrib.admin' in settings.py and path('admin/', admin.site.urls) in url patterns, running the migrations, then uncommenting the admin code again. This was solved with reference to this Stack Overflow article.