In my django project i have to differenziate database name by user. i would to create a table, or a field in user table with database name and in settings.py insert related values checking user connected, but i have two doubt:
How can i insert into DATABASES dict new variable?
DATABASES = { 'default': { 'ENGINE': 'django.db.test.postgresql', 'NAME': myvar, 'USER': 'postgres', 'PASSWORD': 'password', 'HOST': '127.0.0.1', 'PORT': '5432', } }
Settings.py is read before table and db instantiation, how is possible passing values after login?
There is another pythonic way to achieve this result?
Thanks in advance