I’m creating a web app. I need to give each user a separate database. I know this isn’t seen as a great practice and a single database is usually used in these scenarios, but for this project this is the way it needs to be. I have a current working solution in Django. However, my current solution means that if the customer was ever to delete one of their users and add a new one I would have to rebuild and deploy the project to them. Also to clarify, the web app will be deployed on a per customer basis on their own server so this isn’t really a multitenant solution I’m looking for. Would this be easier in flask?
This is my first time using django or web apps in general so I’m still learning a lot. My current solution in Django involves routing requests to a specific database based on the user’s credentials. The database names are still defined in settings.py before deployment and named after the some form of user credentials like an id or email. But like I mentioned, there are lots of cases where I would have to reconfigure the databases in settings.py and redeploy like if the company wants to add a new user that wasn’t there when it was deployed. I need a way for the customer to do this themselves without forcing me to redeploy the web app.
Anthony Leone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.