RafaelMiquelino / dash-flask-login

Implementation of Flask-login on top of Dash.
MIT License
247 stars 81 forks source link

Two proposals #4

Closed sim-17 closed 3 years ago

sim-17 commented 4 years ago

Hi Rafael,

Very great job! thanks a lot.

I suggest two 2 things.

1° If you want to change the table name use " tablename" in "Class User()" as you can see below: class User(db.Model): tablename = 'utilisateurs' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(15), unique=True) password = db.Column(db.String(80))

And if you want use MySQL instead SQLite you can change the 'con' string like this : con = mysql+pymysql://os.environ.get('user'):os.environ.get('mpd')@localhost:3306/os.environ.get('db')

But it's not possible to interpret os.environ value and the connection failed, have you an issue for this, myself it try to use "eval" without success. I put directly the con string in SQLALCHEMY_DATABASE_URI and engine = create_engine(...)

Another little thing, config.read('config.txt') needs the current path to find the config.txt with os.chdir even the txt file is in the same directory than config.py.

Sorry for my english,

Swift

RafaelMiquelino commented 4 years ago

Hi, long time after this was opened but do you have a solution for that? Would you like to issue a PR? To be honest I didn't understand your issue but feel free to further elaborate it or issue a PR if you think it is worth.