How to have two separate models authentication system in the same django project?

37 views
Skip to first unread message

Carlos Perche

unread,
Jun 10, 2014, 8:19:04 AM6/10/14
to django...@googlegroups.com
Hi, 

Is there a way to have multiple implementations of django's 
authentication/authorization system? In my practice blog-type site, 
I've implemented django's auth/auth system as is. I'd like to use the 
default implementation solely for administrators of the site. For 
users of the site, on the other hand, I'd like to have a derivation of 
django's auth/auth system - which will have the same functionality as 
the default implementation, but have a separate set of user tables and 
different fields. 

I need to use the auth.user default just for admin user and I need to use my custom.user for the others usuarios in the same project and database.

It's possible?

Anyone know how to do what I've described? Thanks. 

graeme

unread,
Jun 10, 2014, 9:08:53 AM6/10/14
to django...@googlegroups.com
Have you tried copying the content of contrib/auth and placing it in a directory in your app? It should work (perhaps with a bit of tweaking) BUT you will have to be careful where they both use the same data (for example the setting for the login url) and may have other problems. 

I cannot see what possible benefit you will got from this, and it is probably the wrong thing to do. You should almost certainly either:

2) create a model within your app with a onetoone field pointing at the user for extra information
Reply all
Reply to author
Forward
0 new messages