Creation of database in real time and loading it in the DATABASES variable of Django;

49 views
Skip to first unread message

Sanderson Carmona

unread,
Jan 7, 2019, 1:49:15 PM1/7/19
to Django users
Good afternoon,

I'm using the latest version of Django (2.x) and I'm having a rather complicated task because of the lack of experience I have with the Framework.
To do: I need to use 1 bank as default and others created in real time for the contract client in the company.

Example: You purchased a service and when registering the system create a database with standard tables for its use;
When this client logs in the system will load information from the created bank.
To do this it should read in the database the name of the client's database and load it into the DATABASES variable, that is, if not see another way.

If anyone can help me thank you very much, I already researched and did not find anything on.
Thank you

zekri sidi mohamed hicham

unread,
Jan 7, 2019, 2:52:23 PM1/7/19
to django...@googlegroups.com
you must search about django chennels, i don't have good experiences  with django channels but i think it's may help you.
good chance.
SIDI MOHAMED HICHAM Zekri student.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d0b76c9-f8fb-4c5a-b335-d7bb6cfb9fe0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mario R. Osorio

unread,
Jan 8, 2019, 10:18:02 AM1/8/19
to Django users
I'm not an expert, but this article seems like a good start:

How to Configure Multiple Databases in Django the Simple Way

Michal Petrucha

unread,
Jan 8, 2019, 10:37:55 AM1/8/19
to Django users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,

Messing around with the DATABASES setting during application runtime
is a bad idea, you want to leave that static.

What you're describing sounds like multi-tenancy; there are a number
of packages for this that have been forked off of each other, which
solve this separation using one Postgres schema per tenant in a single
database. Right now the one that appears to be maintained would be
https://github.com/tomturner/django-tenants.

Good luck,

Michal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJcNMOzAAoJEHA7T/IPM/klRJkP+wZX7rO2EKpbhID6iYH28d9j
nFyMBag0RWh4etYEm5FLxz3u+3IPmxoK9n8EuuaP79+XIqgXP/kdnQODd3Wl2I6e
q8TOUiEFAP1cmtbzMwlQ/llBLZZBUpy6SCWe3rlwiTnkV71JCMsu4Y7h3mWgSsT0
zedUXYYUlfwdNQMWy4F0AJA4CYimpZL8bW67ofdcWkg8fWfCegeLPGId7uCMYqlf
YfkuqP4YNSnjakJYyK5pxjHj11XfzR2fw6JZNl5mY48bAZW52/sasKzCzB80syXv
gRj6WJdMBn2nfUosW6MsqsF55IToEM9fsFzCxJZ/ztSrsIiJ7DqN/JEAmeEkEMuF
QA/2n6fFKlsK0VyrZWu61XmVvhGc5FZ1OlcLimt6RsabuTk/YT9vfWq0wScS+d+K
WwI+T2VCWeG/PheF/sFC2q9jGYm7SDAwERL98qldGEpLXCAbZkFtmZcfcA/fCfl7
5KTKGEJFWwPkBK+DNJXVuf/pm7G6v/hpdRqphSgG027D/NHkvtLJd38webAm66nQ
Y4x0BOEAPMs9ebHgvFES3+cwm0J3OCu6g7DSqUrU/qovsHbb8UTmL0j02xsen0ch
gRJbuXCCsIHf2JZgLJ2k36kRfi9FbXy+49PCJovE0iwoZ9zzt3Ddw6K3KBvNQAI8
RojsNvkdIWRmeZN0E/SA
=FjFS
-----END PGP SIGNATURE-----

Sanderson Carmona

unread,
Jan 8, 2019, 1:06:25 PM1/8/19
to Django users
Zekri thank you very much, I'm in the fight with google, rs.

Sanderson Carmona

unread,
Jan 8, 2019, 1:10:10 PM1/8/19
to Django users

283/5000
Well it's Michal, I have a closed bank and I can not put client information inside it, it needs to be in another and this individual database per client, second question. But I appreciate the information, I'm studying it here and in part it solves a part. Thank you very much
Reply all
Reply to author
Forward
Message has been deleted
0 new messages