rafaelmiquelino / dash-flask-login Goto Github PK
View Code? Open in Web Editor NEWImplementation of Flask-login on top of Dash.
License: MIT License
Implementation of Flask-login on top of Dash.
License: MIT License
Hello,
I found some posts about dash authentication here:
https://community.plot.ly/t/get-username-for-authenticated-user-for-basic-auth/13613
and it’s almost working. I keep getting this error:
File “c:\users\User\appdata\local\programs\python\python37\lib\configparser.py”, line 696, in read
self._read(fp, filename)
File “c:\users\User\appdata\local\programs\python\python37\lib\configparser.py”, line 1079, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: ‘config.txt’, line: 1
‘[database]\n’
I decided to start leraning Python/Dash. I am trying to replicate stuff that I did in Excel/Vba using Dash. However I am a beginner without programming backrgoud (I worked on Excel, SAS, SAP…) so many definitions don’t say anything to me.
Also, how can I connect my main app (lets say it’s Dash.py) with your part and retrive user name?
I would very much appreciate if you could get back to me and maybe help me run your code.
BR
Krzyszsz
This seems to work when app.layout
is defined in app.py
. My application is a multi-page dash app and routing is different from a single page app. i.e In my case index.py
contains the app.layout
. My dash application doesn't load when I authenticate user and click on the link to App.
Details here: https://community.plotly.com/t/flask-integration-with-dash-app-routing/53801/3
Hi, I would like to upload an app based on your style to elastic beanstalk.
I understand that for that we need two lines
application = app.server
And then:
if name == 'main':
application.run_server(debug=True, port=8080)
when I try do this by changing "server = app.server" in serve.py to application and then using the above line it doesn't work. I was wondering if you were able to advise how to go about deploying on AWS Elastic Beanstalk.
Many thanks in advance!
Hello,
Thanks for making this repository.
I have been using it with success on a localhost, but as soon as I deploy it, on a hosted server, the user authentication stops behaving. As the user logs in, it registers that the user is authenticated, but within less than a 1s the bool current_user.is_authenticated is set to false.
I have tried everything, and this problem is consistent for my code, that includes the code from this repository, and if one puts this repository on a server and runs it.
Thanks and all the best,
Max H
I am using this repository to create a multi-user authenticated app.
Everything seems to work fine individually, and I can get individual graphs working but when I have more than a dropdown menu the second dependent menu will not populate.
It actually appears no dropdown example will work, even the basic dropdown example.
Any help or a workaround would be greatly appreciated
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
Hi @RafaelMiquelino
I am starting to play with your example and plan to add LDAP / Kerberos support.
Do you have any experience with one or the other?
when I deploy this app with gunicorn and assign more than one worker, the judgement current_user.is_authenticated does not work from tome to time.
Althorough I have logged in, and the url is /success, the page content is /login_fd
Thanks for making this repo.
I found it helpful and used it to make an alternative public version that suits my needs on Gitlab.
If you want to merge my repo into yours that's fine, and just let me know.
Otherwise i'll keep it as a separate repo.
Cheers.
Dear Rafael,
this is a nice project and I have a question to you.
Do you know how to "login" by pressing the "Enter" Button?
Would be great to receive support from you.
Best regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.