I'm trying to set a custom AUTH_USER_MODEL in my settings but it throws me a CircularDependencyError due to some past migrations. (I used the regular User before)
How can I fix this? I don't care about the database it's just a single test object. But can I reset/remove the migrations or do I need to start a whole new project?
Django warns against changing AUTH_USER_MODEL in the docs:
Changing
AUTH_USER_MODELhas a big effect on your database structure. It changes the tables that are available, and it will affect the construction of foreign keys and many-to-many relationships. If you intend to setAUTH_USER_MODEL, you should set it before creating any migrations or runningmanage.pymigrate for the first time.Changing this setting after you have tables created is not supported by
makemigrationsand will result in you having to manually fix your schema, port your data from the old user table, and possibly manually reapply some migrations.
If you don't care about the database, then I would try dropping the database, deleting your existing migrations files and running makemigrations again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With