Django auth without tables "auth_ *"

We would like to use our own tables for user management instead of Django "auth" tables. We already have database tables that include all the necessary information needed by our application, but it is not in Django format. We would prefer not to duplicate the information in the two tables.

We would like to use the auth package, though, since there are very nice features that we don't want to replicate.

I understand that we could build our own auth backend , but this, as far as I can tell, does not eliminate the need for two sets of tables in this case.

Am I right in assuming that we cannot do this? I have not found any documents that discuss how to change the base model used by the auth package. The backend simply pre-populates the user object, which will eventually be stored in auth tables.

Thanks!

+4
source share
1 answer

I think you want to create a custom model. This goes well with the rest of django.contrib.auth and allows you to write it against the old user table. You need to do this with caution and correctly transfer the data (all of them are described in the documentation).

0
source

Source: https://habr.com/ru/post/1299025/


All Articles