views:

34

answers:

1

I currently manage a website, coded in django, that has 2 standard areas - the frontend and backoffice (which is built using django's admin interface).

Recently the customer claimed he wanted 2 diffrent authentications - one for frontend users and another one - for people managing the backoffice.

Until now they both used standard django.contrib.auth authentication.

I know I could make the customer to just use diffrent users (and, maybe, disallow the "backoffice" users to log into the frontend part) but - they want more changes, like: session inactivity on the admin side shortened to few minutes (while on the frontend - to keep it like forever).

Is it possible to define parts of django site to use diffrent authentication? With diffrent cookies, etc?

Or should I use a diffrent domain for backoffice, like to have a frontend on site.com and admin on admin.site.com, then have both run as 2 diffrent applications, using diffrent settings for cookies, etc?

+2  A: 

Django provides a backend authentication interface: http://docs.djangoproject.com/en/dev/topics/auth/#authentication-backends

Here, you can specify how you want the user to authenticate. You can use the local login() methods to authenticate the backoffice users, and whatever else you need for front end you can implement as needed. Either way, this is the place where you define that functionality.

Andrew Sledge