On Jul 19, 2:19 pm, David Marko <[EMAIL PROTECTED]> wrote:
> I know this topis has been discussed already but I stiil havent find
> solution. We would like to build up the application that will be used
> by many customers. After registration the customer will access
> application via its subdomain name:
> eg. cust1 =http://cust1.application.com
> cust2 =http://cust2.application.com
> etc.
>
> This approach requires that authentication should use subdomain name,
> username and password . How can be this scenario accomplished with
> django?
> I think its very common approach when one application is used  by many
> customers and things must work dynamicly ... so using django 'sites'
> approach is not suitable.
>
> Thanks for any advice and hits.
>
> David

If the username is unique to the subdomain, you either have to hack
around the existing User model (as per SH's suggestion) or you need
your own User model for your application (outside of the Django
standard).  I'd probably hack up the django User model and associate a
CustomerUser model to it with the 'real' login, unique to the
Customer.

Once your user is created and associated to a subdomain, you can pull
the subdomain from the request (as daev said,
request.META['SERVER_NAME'] in middleware and make it available on the
session (e.g., use it to look up a Customer object and make it
available on the request or session).

doug.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to