0

I have different user groups based on functionality: customer support, editors...etc

I want to use the same user system and database, but I want to have different interfaces (login, functionality, sub domain) for the different groups that I have, separate from the normal user website interface and login.

How would you do it?

Orca
  • 2,035
  • 4
  • 24
  • 39
  • The simple answer is that your view function checks the logged-in user and dispatches to group-specific handler views. – AdamKG Aug 11 '13 at 16:40
  • @AdamKG What about using separate subdomains and the login functionality since their group is not yet determined? – Orca Aug 11 '13 at 16:52
  • Your login view would check request.get_host() to dispatch instead. If the subdomain is group-specific, you'd want your dispatching views to check request.get_host(), then verify that the user is in the appropriate group, and finally dispatch to the "actual" view. – AdamKG Aug 11 '13 at 17:02
  • @AdamKG I can't leave the question open like that, and a comment is not an answer. Would you post it as a complete answer so I can accept it? – Orca Aug 11 '13 at 19:02
  • Just close the question - there's already more-fleshed-out examples. http://stackoverflow.com/questions/7194341/optimal-architecture-for-multitenant-application-on-django http://stackoverflow.com/questions/1106557/multi-tenant-django-application – AdamKG Aug 11 '13 at 22:58

1 Answers1

0

I ended up using request.get_host() to provide different interfaces for each subdomain, and check in login for the correct group type of the would-be-logged-in user.

Orca
  • 2,035
  • 4
  • 24
  • 39