Converting my Django app so that it uses one database: what approach to use for auth?

19 views
Skip to first unread message

H. de Vries

unread,
Sep 4, 2012, 10:24:26 AM9/4/12
to django...@googlegroups.com
Hey all,

At the moment I have a Django app that has multiple settings files and multiple databases for my customers. I run a separate Django instance for each customer. I'm going to put it all together in 1 database so that I can run it in one instance. This makes creating new customer accounts easier, for example.

Customers will visit domain.tld/customer_name/.

Now the company name gets passed as an argument to the view.

I want the user model to look like this:
user_id user_data ( all the normal fields ) company_id

So when the user logs in, Django has to retrieve the company_id for the current url and then when logging in authenticate this company_id against the user data.

How would one achieve this?


Thank you!

Regards,

Henk.

Reply all
Reply to author
Forward
0 new messages