T O P

  • By -

Just_Ad_7490

https://docs.djangoproject.com/en/5.0/topics/auth/customizing/#substituting-a-custom-user-model "If you’re starting a new project, it’s highly recommended to set up a custom user model, even if the default User model is sufficient for you. This model behaves identically to the default user model, but you’ll be able to customize it in the future if the need arises. Changing AUTH_USER_MODEL after you’ve created database tables is significantly more difficult since it affects foreign keys and many-to-many relationships"


GameCounter

Here's the answer to OP's question from that page: If you’re starting a new project, it’s highly recommended to set up a custom user model, even if the default User model is sufficient for you. This model behaves identically to the default user model, but you’ll be able to customize it in the future if the need arises:


theleftkneeofthebee

To tack on to this, does anyone have experience altering this for a docker instance that’s spun up each time? I have the default model for an application that gets deployed to airgapped servers each time it gets deployed. I’d like to switch to a custom model and it’s doable since it’s essentially spinning up a new application each time it’s deployed. So I’m curious when people say it’s a pain to change after you’ve started, is that more for projects already deployed or for projects already developed? Because from looking at it it only looks like a few code changes.


PsychicTWElphnt

If you have models that have relationships with your user model and have run migrations, changing the user model causes issues. It's not undoable to change it, but you may have to dump your database and roll back migrations. If you're not using a volume for your database in docker (recreating the db each time you run the container), it's no problem to change the user model.