0

How do i configure in flask app.config['SQLALCHEMY_DATABASE_URI'] the username, password and db_name with values captured from url previously.

Example, my app first ask for username, password and db_name and after i want it use then to setup SQLAlchemy.

How do i achieve this?

The reason is that i need to validate against mssql server because all the user names and password they are all there. I'll appreciate all your help. Thanks anticipated.

Felix Ramirez
  • 74
  • 1
  • 8
  • 2
    Seems like in your case it's better to use a plain Sqlalchemy than Flask-Sqlalchemy because Flask-Sqlalchemy is built around a single or limited db connections which are established on startup but your case require dynamic connections and is close to multi-tenant model. – Fine Jan 11 '19 at 08:09
  • Thanks Fian for your attention, but all my SQLAlchemy are based on Flask-SQLAlchemy ORM structure and i need a solutions based on that. – Felix Ramirez Jan 11 '19 at 19:30
  • This SO question, [Flask SQLAlchemy setup dynamic URI](https://stackoverflow.com/q/14491678/2800058) might give you some ideas. – pjcunningham Jan 14 '19 at 18:23

0 Answers0