Q:

authtools in django problems with migrations

I am trying to use Authtools for custom users in django.
I am following documentation from their site:
django-authtools.readthedocs
I started a new project, created admin.
Then I:
inserted authtools in INSTALLED_APPS.
inserted AUTH_USER_MODEL = 'authtools.User' in settings.py
in urls i did:
from django.conf.urls import url,include
from django.contrib import admin
from authtools import urls

from django.contrib import admin
from authtools import urls 
urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/', include('authtools.urls')),]

Finally I ran python manage.py migrate
and i received following:

django.db.migrations.exceptions.InconsistentMigrationHistory:
  Migration admin.0001_initial is applied before its dependency
  authtools.0001_initial on database 'default'.

I have no idea what is going on. Does anyone understand?
Thank you.

A:

You need to add authtools to INSTALLED_APPS and set AUTH_USER_MODEL = 'authtools.User' before you do the initial migration.
Since it's a new project, it should be straight forward to drop the database, recreate it, then run migrate again.

