views:

61

answers:

1

We would like to use our own tables for user management instead of the Django "auth" tables. We already have database tables that include all of the relevant information our application needs but it isn't in the Django format. We would prefer not to have the information duplicated in two tables.

We would like to utilize the auth package, though, as there is some very nice functionality that we don't want to replicate.

I realize we could build our own auth backend, but that doesn't, as far as I can tell, remove the need for two sets of tables in this case.

Am I correct in assuming that we cannot do this? I have found no docs that discuss how to modify the underlying model that the auth package is using. The backend simply pre-populates the user object that would eventually be saved in the auth tables.

Thanks!

A: 

http://docs.djangoproject.com/en/dev/ref/models/options/#id1

To override the database table name, use the db_table parameter in class Meta.

If your schema matches the one django.contrib.auth uses by default, all you need to do is modify the table name. Otherwise, you're looking pretty screwed.

I recommend switching over to using django.contrib.auth instead of using your own tables though. Most third party Django applications also make use of django.contrib.auth, so you'll have additional applications readily available in the future if you decide to conform.

rcoyner