MultiTenant Connections

19 views
Skip to first unread message

Emanuel Araújo

unread,
Nov 17, 2016, 12:44:15 PM11/17/16
to Django users
Hi,

I need to implement multiconnections on distinct customers on my app.
the cenario is:
I have a website and my customers put on form a username.  So, I need that Django connect on postgresql setting schema-name same a username on request.  When I connect on postgresql with a username, the search_path is automatic set to same username.  It's ok.
A each connection must to set the username and search_path, cause each user has a unique schema on database.
This situation is ok when I had few customers, but now, a lot of customers are sign and I don't restart app when exists connections actives.
How to do that?  I Created a new schema on postgresql, created a new objects but I need that my app find it whitout restart django server.

Thanks! 

Emanuel Araújo

unread,
Nov 18, 2016, 6:12:07 AM11/18/16
to Django users


This link resolved a question: https://gist.github.com/bubenkoff/005ea57b63251dafe81f
I needed only change some line to work a python3 version.

Thanks
Reply all
Reply to author
Forward
0 new messages