[Fixed]-Django not searching correct table name for custom user model

1👍

Not sure what you mean by correct table in this case, but this behavior sounds about right since your model is called user and is declared in an app named accounts.

You can overwrite the auto-generated table name using class Meta attribute db_table: https://docs.djangoproject.com/en/1.10/ref/models/options/#db-table

Also just a note, the django docs recommend that your custom user model inherits from AbstractBaseUser, otherwise you will be responsible for implementing quite a few things on your own. https://docs.djangoproject.com/en/1.10/topics/auth/customizing/#specifying-a-custom-user-model

👤fips

Leave a comment