How to Add a User Authentication Service (Login Form) in Streamlit

  Рет қаралды 101,310

Coding Is Fun

Coding Is Fun

Күн бұрын

Пікірлер: 273
@CodingIsFun
@CodingIsFun 2 жыл бұрын
🚨 *IMPORTANT* 🚨 Shortly after releasing the video, the streamlit-authenticator package got updated. The new version is incompatible with the syntax I have shown in the video. If you want to follow along with the video, please use version 0.1.5 : *pip install streamlit-authenticator==0.1.5* 👉[PART 2] Store the passwords in a database: kzbin.info/www/bejne/m3TFeWWkhbFsqbc *Happy Streamlit-ing!* 🎉
@mikekaspari1357
@mikekaspari1357 2 жыл бұрын
Great. Does this work with the homepage function you have shown last week?
@mikekaspari1357
@mikekaspari1357 2 жыл бұрын
Hi Sven, I tried by myself. It worked
@GidonLoewenberg
@GidonLoewenberg 2 жыл бұрын
Thanks for the tutorial (and the others too!). Would you be able to do an update for the new syntax? The 0.1.5 version has a bug where the username is case sensitive. This has been resolved in 0.2.1 and I would like to use it but can't figure out how to implement it correctly.
@poseidon907
@poseidon907 2 жыл бұрын
any plans of updating the video to the newest version?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@poseidon907 Once the package is more stable, I might do another video.
@PinkPixelRabbit
@PinkPixelRabbit Жыл бұрын
Thanks for making these useful tutorials, Sven. You teaching style makes everything look simple and clear!
@CodingIsFun
@CodingIsFun Жыл бұрын
*I am glad to hear you are enjoying them, thanks for watching and for the comment!*
@rics6035
@rics6035 Жыл бұрын
one year later, but still gold! Thanks a lot :)
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for the kind words. Glad you liked the video! :)
@splamb6474
@splamb6474 2 жыл бұрын
Yes please, can we have a tutorial on storing users in a db?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching the video & your comment. If more people would like to see it, I will be happy to make another video on storing the users in a DB :)
@reilagji4752
@reilagji4752 2 жыл бұрын
Yes please!
@barryvorster4696
@barryvorster4696 2 жыл бұрын
Yes please
@chriskeo392
@chriskeo392 2 жыл бұрын
Yup I vote too
@amsathsherif659
@amsathsherif659 Жыл бұрын
​@@CodingIsFunyes please sir
@bladimirjuniorpelaezhernan6863
@bladimirjuniorpelaezhernan6863 Жыл бұрын
Oh this man is incredible, I love python language. this channel have been very useful for me, to improve my Python learning and make new things thanks to you, greetings from Colombia dear friend.
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and for your kind words! I'm so glad to hear that my channel has been helpful for you in improving your Python skills. By the way, I was in Colombia last year for vacation and was amazed by the friendly people there. Greetings to you too! 👍
@theseenandunseen
@theseenandunseen 2 жыл бұрын
I only discovered your channel today. What a gem ! Keep up the good work, mate
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Welcome aboard! Glad you like the videos! Thanks for watching and taking the time to leave a comment! 🤩
@gustavojuantorena
@gustavojuantorena 2 жыл бұрын
Great tutorial. It would be awesome if you make one about how to store the passwords in a database!
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you & well noted!
@michalfrankowski5328
@michalfrankowski5328 2 жыл бұрын
I am with you on that! It would be cool to know that.
@dishangmehta4397
@dishangmehta4397 2 жыл бұрын
Yes.. it would be of a great help if you could make a tutorial for database connectivity as well.. As always.. thanks for such easy to understand and to the point video
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@dishangmehta4397 Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@ramykhalil4426
@ramykhalil4426 2 жыл бұрын
Great tutorial, yes we would appreciate having another tutorial to connect the authentication to a database where users can also change their credentials. Thanks again, best channel
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching and your comment!
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@gerhardvandalen4232
@gerhardvandalen4232 2 жыл бұрын
Great video, was exactly what I was looking for. Would definitely want to see a tutorial on how you setup Streamlit for user registration with passwords that feeds into a database (SQL lite). Keep up the good work
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you!
@symtrial
@symtrial 2 жыл бұрын
Although my major is not close to this type of science, but I just subbed to thank you for your github work that meant to help other students.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for your sub & welcome aboard!
@EmptyNonsens
@EmptyNonsens 2 жыл бұрын
Wow, just discovered the channel and already found several solutions of my problems. Thank you for your work
@CodingIsFun
@CodingIsFun 2 жыл бұрын
I'm so happy to hear that you've found the videos useful! Thanks for watching and taking the time to leave a comment!
@ceefarbs560
@ceefarbs560 2 жыл бұрын
Congrats on 20k subs man
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks a lot! :) 🎉
@stephenhealy3963
@stephenhealy3963 2 жыл бұрын
Another great video. Dankeschön! Yes, please can we have a video on storing hashed passwords in a DB :o)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Danke! Well noted! :)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@MehulPatel-re8mc
@MehulPatel-re8mc 10 ай бұрын
Such clear and succinct instruction. Thank you!
@CodingIsFun
@CodingIsFun 10 ай бұрын
Glad I could help! Thanks for watching and for the kind words. Cheers, Sven ✌️
@maseedilyas203
@maseedilyas203 2 жыл бұрын
Awesome video as always, thanks for the useful content 👌
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you! :)
@loicmbolle
@loicmbolle Ай бұрын
thank for share this solution and great thank for explain it very well. i have Python 3.12.0 and last version of St-auth today but the fonction generate() is not reconized
@CodingIsFun
@CodingIsFun Ай бұрын
Please read the pinned comment. Thanks 😊
@lorenzweb
@lorenzweb 2 жыл бұрын
Agree, this would super valuable if you could make the the authentication module look into a database instead of loading all the users into the script :-)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Well noted :)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@johnadam3269
@johnadam3269 Жыл бұрын
That was great. Good Job.💪
@CodingIsFun
@CodingIsFun Жыл бұрын
Glad you liked it. Thanks for watching and taking the time to leave a comment!
@RandyGriggs
@RandyGriggs 4 ай бұрын
Loved the video and yes I too would like to see your video on using da for storing credentials. I have setup using the authenticator and works well on login but when I logout it takes me back to the login page which is perfect but the sidebar menu still shows with the menu items but does not show any data. On logout I want the sidebar to be removed and take me back to the login page. after logout that only happens if I manually F5 the app then the sidebar is removed. I hope you can help Thank you Randy
@CodingIsFun
@CodingIsFun 4 ай бұрын
Hi Randy. Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help. -Sven ✌️
@MenteyExito
@MenteyExito Жыл бұрын
Great video! What if, I have 5 different pages inside my app for 5 different users. Is there a way I can create a login page where user 1 enters his credentials and see HIS dashboard and not the other 4?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thank you for watching. This seems feasible using the Streamlit Authenticator package. Please refer to the documentation: github.com/mkhorasani/Streamlit-Authenticator. For example, you could define various roles and add them to your database when someone registers. Within your Streamlit app, you would then need to check if the respective user has the required role to access the app. Happy Coding!
@MenteyExito
@MenteyExito Жыл бұрын
@@CodingIsFun Thank you!
@aishworyann4928
@aishworyann4928 Жыл бұрын
Hello sir, firstly thanks for these type of informative videos. Secondly i am facing TypeError: list indices must be integers or slices, not str this error in line 22 , can you please help sir.
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@florianroeseler2404
@florianroeseler2404 2 жыл бұрын
Very useful, thank you!
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Happy to hear that you find it helpful. Thanks for watching and your comment!
@LucasSerena-v6o
@LucasSerena-v6o 9 ай бұрын
Great video. Is it possible to render the logout button as an option of the three-dots menu? or maybe at the left of the icon? I cant find anywere a way to override that behavior.
@CodingIsFun
@CodingIsFun 9 ай бұрын
As far as I know, this is not natively supported.
@khalilebdelli6199
@khalilebdelli6199 Жыл бұрын
Thank you for creating such cool tutorials, have you uploaded any tutorials on how to store user info in a database?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. Yes, I have and I have also seen, that you found it already ;) kzbin.info/www/bejne/m3TFeWWkhbFsqbcsi=PNGbDS_5rPJIhy9V
@ricardo.alves.campos
@ricardo.alves.campos 2 жыл бұрын
As always, excellent video and I’m curious to see how it works with storing the password in a database.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
As always, thanks for watching! :)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@usernada
@usernada 2 жыл бұрын
Super helpful, thank you! As you mentioned, the streamlit-authenticator package got updated. Can minor changes be applied to meet those requirements? Or will it require an overhaul? Thanks!
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching the video. Sorry, but I do not understand your question. Can you perhaps elaborate on what it is you're trying to achieve? Please provide some additional info. Thanks!
@usernada
@usernada 2 жыл бұрын
@@CodingIsFun Since the streamlit-authenticator package got updated, how would you update the code to make it compatible with the new syntax? I'm curious whether this is a small or big change. What is the pros and cons of using the authenticator package version 0.1.5 versus the new one? Thanks again!
@LossBrTM
@LossBrTM 3 ай бұрын
Hello Sven, how's things? Great tutorial. I'd like to ask you, if there's an option for "forgot password" that we can input in the code with the functions of reseting the password as well. Thanks in advance.
@CodingIsFun
@CodingIsFun 3 ай бұрын
Hey there. Yes, there is an option for that. Have a look here: github.com/mkhorasani/Streamlit-Authenticator?tab=readme-ov-file#10-creating-a-forgot-password-widget Happy Coding! -Sven ✌️
@rasmuslindbjerre3686
@rasmuslindbjerre3686 9 ай бұрын
Thanks for the video! I have an additional question on top of this; do you know how RLS works in python/streamlit (ie. user pparker should only be able to see data subset A and rmiller should only be able to see subset B. A and B is part of the whole dataset yet they're not allowed to see eachothers data)?
@CodingIsFun
@CodingIsFun 9 ай бұрын
Thanks for watching. This is possible with conditional statements. As shown, you could retrieve the name (or access group) and then only show certain data to that person/group. Happy Coding! Cheers, Sven ✌️
@2001gpu
@2001gpu 8 ай бұрын
When clicking the log out button nothing happens. However, I want to be redirected to the login form. Do you know what the problem could be? Thank you for a great video!
@HuramHk
@HuramHk 7 ай бұрын
Hello, can you please help me? I've created my Streamlit login page, but after authentication, instead of showing the next page, it displays both the login page and the next page simultaneously. How can I display only the next page? Thank you for your response.
@CodingIsFun
@CodingIsFun 7 ай бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help. Cheers, Sven ✌️
@alanmartins1497
@alanmartins1497 2 жыл бұрын
Great video, this is very helpfull !
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you! 👍
@adityapatil5713
@adityapatil5713 4 ай бұрын
Showing attributeerror: 'hasher' object has no attribute 'generate'
@hun2up390
@hun2up390 Жыл бұрын
Thank you for your turorial. Your videos are always helpful! But I have a question. I made a streamlit website which has ‘main.py’ in ‘main’ folder, and it has ‘sub.py’ in ‘pages’ folder which is under ‘main’ folder. So usually I enter ‘sub.py’ page through the ‘main.py’ page. In this case, can I make sure that ‘sub.py’ can be secured with only your codes as well?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and the kind words. I have not tested it with a multipage app, but feel free to try it out yourself. Happy Coding! :)
@peakpointforex
@peakpointforex Жыл бұрын
Thank you so much for this video. Well explained. I have an error though when I deploy my streamlit app on streamlit cloud: TypeError: __init__() got multiple values for argument 'cookie_expiry_days' Any ideas on how to solve this?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. Please check out the pinned comment
@peakpointforex
@peakpointforex Жыл бұрын
@@CodingIsFun Thank you 👍
@peakpointforex
@peakpointforex Жыл бұрын
The new version of streamlit works now. Thank you so much 🙂
@sujin160
@sujin160 Жыл бұрын
Hi bro. Good video. How did you change the UI of login page?
@CodingIsFun
@CodingIsFun Жыл бұрын
Hey bro. There is not parameter to change the design of the login page. You would not apply some custom CSS. Here is the official documentation: github.com/mkhorasani/Streamlit-Authenticator Happy Coding!
@giressepatrick5275
@giressepatrick5275 Жыл бұрын
Thank you very much 👏👏 so I want to know :how to do it with multi-page streamlit application ? when I try it, authentication is only for the page where I put the code and the user can easily access other pages without authentication.
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. I have not tried it with a multi-page app. You might want to check out the docs to see if that is possible or raise an issue/question here: github.com/mkhorasani/Streamlit-Authenticator
@giressepatrick5275
@giressepatrick5275 Жыл бұрын
@@CodingIsFun ok thank you very much for your prompt reaction
@Verstehdieaktie
@Verstehdieaktie Жыл бұрын
Vielen Dank ❤
@CodingIsFun
@CodingIsFun Жыл бұрын
Danke fürs Anschauen! :)
@aditirajesh8314
@aditirajesh8314 Жыл бұрын
Hi there, this video is incredible, love your streamlit tutorials. Just a question, the streamlit authentication never turns true for me even when i enter the correct login id and password. I am using a database but I have connected it perfectly to python.I followed your video to the t. Do you have an idea where I might be going wrong?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@shadeersadikeen1052
@shadeersadikeen1052 3 ай бұрын
However, when the application is deployed, the GitHub repository link is displayed at the top of the Streamlit app. This allows users to access the repository, retrieve the '.pkl' file, and potentially use it to access the application. My goal is to keep my repository private and authenticate users through it. What would be the best approach to achieve this?
@CodingIsFun
@CodingIsFun 3 ай бұрын
Make it private and deploy it on a web server? E.g. using Render, Heroku, ..
@georgikovachev8132
@georgikovachev8132 Жыл бұрын
Hi Sven, thank you for sharing this information. Do you know why when you click logout button the side bar appears not to be hidden. How can you check the state of the logout button? Thank you in advance!
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. You might want to check the documentation of the package and/or create an GitHub issue: github.com/mkhorasani/Streamlit-Authenticator
@seekingtruth9417
@seekingtruth9417 2 жыл бұрын
Thanks for the video. This is very helpful. Can you please let us know, how to add new users once the project is in production?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks! I am working on a follow-up video to store the credentials in a database. I plan to release the video within the next week. Stay tuned!
@georgecodeing7907
@georgecodeing7907 2 жыл бұрын
thank u for the helpful tutorial
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Happy to hear that it was helpful; thank you for taking the time to leave a comment and for watching the video!
@fongz2087
@fongz2087 11 ай бұрын
When I run the script at 2:19 the termainal show me "File "", line 1, in NameError: name '__file__' is not defined. Did you mean: '__name__'?", How can i fix it ?
@CodingIsFun
@CodingIsFun 11 ай бұрын
Hey there, thanks for watching the video! I'm sorry I can't help you with your problem based on the information you provided. To give me a better idea of what's going on, it would be super helpful if you could write down which line of code is causing the error, let me know if you modified the code from the tutorial, and explain in more detail what you did to troubleshoot the problem. Don't forget to also give me some context about your setup and environment. If you're having trouble figuring things out, another option is to join our Discord server at pyhtonandvba.com/discord. You can ask your question there and maybe someone in the community can help out. Thanks for understanding.
@arcanum360YT
@arcanum360YT Жыл бұрын
Hello, it seems that the streamlit version has been updated and I've seen somewhere it uses a dict as part of the authenticator. Kindly do another video on this. Thankyou
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. That is correct, as mentioned in the pinned comment: Shortly after releasing the video, the streamlit-authenticator package got updated. The new version is incompatible with the syntax I have shown in the video. If you want to follow along with the video, please use version 0.1.5 : pip install streamlit-authenticator==0.1.5
@arcanum360YT
@arcanum360YT Жыл бұрын
Ok thanks@@CodingIsFun
@BumbaUmba84
@BumbaUmba84 Жыл бұрын
in our network of the organization everyone has static addresses, how to get the address of the client in order to check that it is possible to log in from this workplace
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. Not sure how to implement that
@S-Lomar
@S-Lomar Жыл бұрын
Well done 🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks! 😍
@MrCwitharpg
@MrCwitharpg 2 жыл бұрын
Amazing content, please create tutorial on storing user details in a database
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks! I am already working on that tutorial. Stay tuned! :)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@emeraldshuttlers203
@emeraldshuttlers203 2 жыл бұрын
Loved it
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Glad you liked it. Thanks for watching.
@gustavofelicidade_
@gustavofelicidade_ 2 жыл бұрын
Many thanks!!!!
@CodingIsFun
@CodingIsFun 2 жыл бұрын
You're very welcome! Thank you for watching and for the comment!
@honeyvasu1599
@honeyvasu1599 8 ай бұрын
Hello there, I'm getting some problem in the login authentication. I am always re-authenticating the user . If iam refreshing the page it asking me for re-authentication. I am using vs code
@CodingIsFun
@CodingIsFun 8 ай бұрын
Thanks for watching. Hard to tell from a distance. Cheers, Sven ✌️
@yuriijooble8807
@yuriijooble8807 2 жыл бұрын
Hi! thanks for the video, a lot of work done before me, but could you advise, how can I face it with multiapp ? login form is displayed only in Home page, but other pages still visible on the left panel (as different apps)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you very much for watching the video and your comment. Your requirements are well noted. Yet, I receive many requests for creating individual solutions. As much as I want to help, I simply do not find the time in my daily schedule to develop & test all the different requests. I hope you can understand. Thank you!
@sweetie_py
@sweetie_py Жыл бұрын
thank you so much. i have a question, how can I add a user authentication service with multi-pages streamlit app since all my pages lie in the sidebar? for single page, we can just do an if else and then render that page. but what is the case where i have multiple pages? Thanks
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. I have not tried it with a multipage app yet, sorry!
@ibaha411
@ibaha411 Жыл бұрын
@codingisfun can you make a new video for the latest version of the streamlit?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thank you for watching the video & your suggestion.
@MisterThehood12
@MisterThehood12 2 жыл бұрын
Great video! Is it possible to have a login only for admins that gives them access to an admin page? Rest of the web app would be no required login and wouldn't be able to access this admin page. :)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching. Not that I know of 😕
@srilaxmip9
@srilaxmip9 Жыл бұрын
Could you create a video on how we can get user statistics, like number of active users using your app currently? Note: In my app, I dont have any authentication enabled, but accessible to all users within our organization with the url. we deployed the app using aws.
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and your video suggestion.
@srilaxmip9
@srilaxmip9 Жыл бұрын
@@CodingIsFun Do you know any streamlit packages which can serve this purpose?
@lebdev853
@lebdev853 2 жыл бұрын
Greate tutorial. What about having groups that contains many users . Like users under the group of sales department User under the group of IT department. Can this be done ??
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you! I think you have everything you need to implement it. A straightforward implementation would be to create a dictionary to assign each person to a department. In the streamlit app, you could then restrict the content based on the department.
@abhishekbhosale3628
@abhishekbhosale3628 2 жыл бұрын
Great tutorial !! Curious to know how to store the password in a databse. Hope you will make another tutorial video on it soon Also i want to know that can use use streamlit-authenticator and Google firebase to store the usernames and passwords?? If yes can you please explain it in the upcoming videos
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching the video & your suggestions!
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@abhishekbhosale3628
@abhishekbhosale3628 2 жыл бұрын
@@CodingIsFun Thank you so much
@ArbazHBamboowala
@ArbazHBamboowala Жыл бұрын
sorry am again commenting so you would see it and comes to your attention: Hey Sven, Thank you so much for this video. I did tried it to my code, I am facing an issue. Screen goes completely blank and I cannot see anything. I added debugging using st.write("this session 1 has error") and so on but nothing comes up. Also inspect element shows display:blocked (strike on it). Dont know what went wrong, I added the code under function def main()?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@ArbazHBamboowala
@ArbazHBamboowala Жыл бұрын
@@CodingIsFun you have an email address where I can share my code? I am really enthusiastic about developing this application of mine. I have been looking for a job since 1 year and still havent landed one, I would really appreciate even a chunk of help!!!
@villeolof2000
@villeolof2000 2 жыл бұрын
Awesome! But I can somehow not create the file, should there be anything where it says "__file__" or "file_path" and should it be inside " " marks? I can't create it
@villeolof2000
@villeolof2000 2 жыл бұрын
Never mind, I fixed it
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching. Glad you fixed it.
@villeolof2000
@villeolof2000 2 жыл бұрын
@@CodingIsFun Thank you! I am already on the next video in this series, the verification email takes long time for me to get though. I’ll be patient, but I have resent it multiple times, hopefully I get the verification email soon! :D Your tutorials have leaned me so much!
@villeolof2000
@villeolof2000 10 ай бұрын
@sandhupb02 I didn’t. So if you ever fix it, please let me know how. 😀
@christianrauth1425
@christianrauth1425 2 жыл бұрын
🔥 🚀
@CodingIsFun
@CodingIsFun 2 жыл бұрын
🚀🚀🚀
@danielcampos8986
@danielcampos8986 Жыл бұрын
very good
@CodingIsFun
@CodingIsFun Жыл бұрын
Glad to hear you liked it! Thank you for commenting and watching.
@EnigmaAI-88
@EnigmaAI-88 Жыл бұрын
How to create that pickle file ?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. I have shown that in the video. Kindly rewatch it! :)
@EnigmaAI-88
@EnigmaAI-88 Жыл бұрын
@@CodingIsFun thank you
@mastoring
@mastoring 2 жыл бұрын
Thank you very much! I am coming across the following error: KeyError: 'st.session_state has no key "authentication_status". Did you forget to initialize it?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
At which part of the video (timestamp) and which line number?
@mastoring
@mastoring 2 жыл бұрын
@@CodingIsFun it refers to the line 26, timestamp is 4:14
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@mastoring please ensure to use version 0.1.5 and try again (as written in the pinned comment)
@ordaflash
@ordaflash 2 жыл бұрын
Hello, i got the same Error, what did you do to resolve it please ?
@Shakprab
@Shakprab Жыл бұрын
something is off here, the code does not match the current state of streamlit design
@CodingIsFun
@CodingIsFun Жыл бұрын
Please read the pinned comment, thanks
@cse_07_akhilsanthosh96
@cse_07_akhilsanthosh96 10 ай бұрын
It says streamlit-authenticator has no attribute 'hasher' What to do ?
@CodingIsFun
@CodingIsFun 10 ай бұрын
Shortly after releasing the video, the streamlit-authenticator package got updated. The new version is incompatible with the syntax I have shown in the video. If you want to follow along with the video, please use version 0.1.5 : pip install streamlit-authenticator==0.1.5
@jordanbbx7736
@jordanbbx7736 9 ай бұрын
Can you make another vid of the same topic with the updated version?​@@CodingIsFun
@ericsamson731
@ericsamson731 2 жыл бұрын
So the pickle file holding the passwords and usernames is secure? If I had this on GitHub or somewhere could someone read into the pickle file to get the values?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
The pickle file holds only the hashed passwords (1:51 min). As mentioned (6:20 min), you could also store them in a database. That said, even if the hashed passwords are accessible, it will be hard to crack them: security.stackexchange.com/a/130946
@wanpynskhempyngrope9263
@wanpynskhempyngrope9263 2 жыл бұрын
I'm doing a project in streamlit using firebase but I'm having issue where since streamlit runs the code top to bottom i tried using the session state but I'm not if it's right or wrong but it's not working what i wanna achieve is am able to login n then if i refresh the page or go to a new section....it should maintain the last session.... without logging in again..... Cause if i refresh page login page appears again... 😢 Anyone got any idea or please make a video on this topic
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching the video & your video suggestion.
@ArminEskandary
@ArminEskandary 2 жыл бұрын
Bro I have a question . Plz answer . Does streamlit works with cpanel ?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
As far as I know, it doesn't.
@InteligenciadeNegocios
@InteligenciadeNegocios 2 жыл бұрын
Hi, thank you for this video. Can you please help me with the following error: __init__() got multiple values for argument 'cookie_expiry_days' Thank you
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching. Kindly have a look at the pinned comment.
@InteligenciadeNegocios
@InteligenciadeNegocios 2 жыл бұрын
@@CodingIsFun Thank you! Now is working! excellent content!
@phucle1669
@phucle1669 2 жыл бұрын
thank your
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you for your comments under my video. I appreciate your support! :)
@basheer7619
@basheer7619 2 жыл бұрын
__init__() got multiple values for argument 'cookie_expiry_days' how to solve this error sir
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Check out the pinned post
@Gulo0fficial
@Gulo0fficial 2 жыл бұрын
I have problem when running my app.py EOFError: Ran out of input Traceback: File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit untime\scriptrunner\script_runner.py", line 556, in _run_script exec(code, module.__dict__) File "E:\StreamlitProject\Sales Dashboard\app.py", line 24, in hashed_passwords = pickle.load(file)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please try downgrading your streamlit-authenticator package to 0.1.5 by running *pip install streamlit-authenticator==0.1.5* . Afterwards, kindly try it again. Thank you!
@sohamsinha3419
@sohamsinha3419 Жыл бұрын
Hey, thanks for the video. I used streamlit-authenticator version 0.1.5 for the same code, but I am still facing some errors in my file. I am facing the error: "no module named 'streamlit_authenticator.hasher'" in the hashed_passwords = pickle.load(file) line. Could you please look into this?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@sohamsinha3419
@sohamsinha3419 Жыл бұрын
Nevermind, It worked. Thanks!
@CodingIsFun
@CodingIsFun Жыл бұрын
@@sohamsinha3419 how did you solve it?
@sohamsinha3419
@sohamsinha3419 Жыл бұрын
@@CodingIsFun I was importing data from excel as a means to store usernames and passwords somewhere outside the code editor. One of the passwords was an integer and the hasher function doesn't allow integers to be encoded, which was a main part of my problem. I also had to reinstall streamlit-authenticator with the version 0.1.5 (it didn't save the version somehow).
@aryanprabhakar9891
@aryanprabhakar9891 2 жыл бұрын
👍🏻
@CodingIsFun
@CodingIsFun 2 жыл бұрын
👍👍
@austinmerrill752
@austinmerrill752 Жыл бұрын
yes how about tutorial on connectiong to database for passwords
@CodingIsFun
@CodingIsFun Жыл бұрын
Here you are: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@zahiruddinzahidanishah787
@zahiruddinzahidanishah787 2 жыл бұрын
Great video. I have tried several times, but received an error stating: TypeError: list indices must be integers or slices, not str Traceback: File "/opt/anaconda3/lib/python3.9/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script exec(code, module.__dict__) File "auth.py", line 41, in authenticator = stauth.Authenticate(names, usernames, passwords, File "/opt/anaconda3/lib/python3.9/site-packages/streamlit_authenticator/authenticate.py", line 36, in __init__ self.credentials['usernames'] = {key.lower(): value for key, value in credentials['usernames'].items()} Any idea what caused this error? TQ
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching. Shortly after releasing the video, the package got updated and is not compatible with the syntax I have shown in the video. If you want to follow along with the video, please use version 0.1.5 👉 "pip install streamlit-authenticator==0.1.5"
@zahiruddinzahidanishah787
@zahiruddinzahidanishah787 2 жыл бұрын
@@CodingIsFun greats, now it works well. Thank you, sir.
@ahmedsayed7138
@ahmedsayed7138 2 жыл бұрын
@@CodingIsFun when i set my package to version 0.1.5 everything worked perfect. but when i deployed to heroku the first time I got: No module name streamlit_authenticator and the second time my app crashed !! can you help me?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@ahmedsayed7138 Did you include it in the requirements.txt file?
@JaidMirajkar
@JaidMirajkar 2 жыл бұрын
Can anyone please tell me how to stop the login form appearing again when I refresh the entire page? I know streamlit executes the code from top to bottom. I even tried @st.cache on top my function but seems like my entire application disappears after using it.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Sorry, but I cannot replicate this issue. Usually, the login credentials should be stored in a cookie, as explained in the video.
@JaidMirajkar
@JaidMirajkar 2 жыл бұрын
@@CodingIsFun Thank you for the prompt response. The login and logout mechanism are working as expected. But if you see in your video at 6:08, when you hit the refresh button, the login page appears for a split second and then disappears. That is my issue. I don't want to see that page once I am into my home page or into my main dashboard.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@JaidMirajkar As far as I know, there is not fix to this issue
@sushilmudgal203
@sushilmudgal203 Жыл бұрын
facing script runner error how to resolve ?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@sushilmudgal203
@sushilmudgal203 Жыл бұрын
@@CodingIsFun Can you write an erp software code for me for student employee management system
@CodingIsFun
@CodingIsFun Жыл бұрын
@@sushilmudgal203 Nope, sorry
@MadhuriBagade-tr7yc
@MadhuriBagade-tr7yc 4 ай бұрын
its showing project key error is there any project key
@CodingIsFun
@CodingIsFun 4 ай бұрын
Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@prasadsaitavadekar
@prasadsaitavadekar 2 жыл бұрын
is there any option for forgot password or reset password?
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Yes, with the new release: github.com/mkhorasani/Streamlit-Authenticator#4-creating-a-password-reset-widget
@prasadsaitavadekar
@prasadsaitavadekar 2 жыл бұрын
@@CodingIsFun Small video on this would be great, Thank You.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@prasadsaitavadekar If I find the time, I will do it
@psg3127
@psg3127 2 жыл бұрын
@@CodingIsFun i cannot make this work so indeed it would be fantastic to have a video on this. thanks !
@diogomonteiro7022
@diogomonteiro7022 Жыл бұрын
I have a streamlit_autheticator problem, could anyone help me? KeyError: 'usernames'
@CodingIsFun
@CodingIsFun Жыл бұрын
Shortly after releasing the video, the streamlit-authenticator package got updated. The new version is incompatible with the syntax I have shown in the video. If you want to follow along with the video, please use version 0.1.5 : pip install streamlit-authenticator==0.1.5
@diogomonteiro7022
@diogomonteiro7022 Жыл бұрын
thank you very much! I managed to make it work..
@oussamasassour6090
@oussamasassour6090 2 жыл бұрын
Hi it is verry interesting, but i still have this error of truncating.any help pleas ? ""UnpicklingError: pickle data was truncated"">> hashed_passwords = pickle.load(file)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
@bomb143
@bomb143 2 жыл бұрын
I tried to install pip install streamlit-authenticator==0.1.5 . There is a error they are showing it to me ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\\programdata\\anaconda3\\lib\\site-packages\\jwt\\algorithms.py' Consider using the `--user` option or check the permissions. This is what the error its showing to me help me please
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Please try " pip install streamlit-authenticator==0.1.5 --user"
@bomb143
@bomb143 2 жыл бұрын
@@CodingIsFun oh it worked. Thanks
@TheAlucarb
@TheAlucarb 2 жыл бұрын
i did all the steps but says inccorect password even thou is the correct one
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Hard to tell from a distance. Sorry, that I cannot help you.
@TheAlucarb
@TheAlucarb 2 жыл бұрын
@@CodingIsFun thanks anyways, i belive is the pickle file maybe the program is not reading it
@TharushikaHettiarachchi
@TharushikaHettiarachchi 2 жыл бұрын
If you got an error as 'cannot import name 'path' from 'pathlib'', then change the following code lines # from pathlib import path to import pathlib and #file_path = path(__file__).parent / 'hashed_pw.pkl' to file_path = pathlib.Path(__file__).parent / 'hashed_pw.pkl'
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Pathlib is a core Python module available in Python 3.4 and above. To import it ensue to use a capital letter (as shown in the video): from pathlib import Path
@TharushikaHettiarachchi
@TharushikaHettiarachchi 2 жыл бұрын
@@CodingIsFun Thank you
@swahiliicttutorials5568
@swahiliicttutorials5568 Жыл бұрын
i wish you could use a database because in real world, users are in the database
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. Here you are: kzbin.info/www/bejne/m3TFeWWkhbFsqbc
@Master_of_Chess_Shorts
@Master_of_Chess_Shorts 2 ай бұрын
the secret key should be read from an environment variable not hardcoded
@CodingIsFun
@CodingIsFun 2 ай бұрын
Which secret key are you referring to? I mentioned that you could store the usernames and hashed passwords in a database (at 6:23 min in the video). In fact, I also created a tutorial on that.
@Master_of_Chess_Shorts
@Master_of_Chess_Shorts 2 ай бұрын
@@CodingIsFun at 3:43, what you refer as a "random key" is used to encrypt the cookie data so the session cannot be tampered. You should set it as an environment variable, read the key from the environment variable in your code. It's a small point and your video is great, this is just additional security and best practice so that viewers are aware of this point. Authentification could be a risky business in certain contexts.
@amirouchedjema8082
@amirouchedjema8082 Жыл бұрын
thank you for the video very useful but it works just with streamlit-authenticator==0.1.5
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. That is correct (as stated in the pinned comment) :)
@thanglt
@thanglt Жыл бұрын
Great video. I don't know how to reset the password and update it to hashed_pw.pkl ' file?
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks for watching. Please check out the provided examples on GitHub: github.com/mkhorasani/Streamlit-Authenticator Happy Coding!
@thanglt
@thanglt Жыл бұрын
@@CodingIsFun Thank you very much!
@suthanchandru5412
@suthanchandru5412 2 жыл бұрын
How to add logout bro….
@CodingIsFun
@CodingIsFun 2 жыл бұрын
It's explained in the video
@lucasnascimento_xlsx
@lucasnascimento_xlsx Жыл бұрын
Supar
@CodingIsFun
@CodingIsFun Жыл бұрын
Thanks! :)
@MStConsultancy
@MStConsultancy 2 жыл бұрын
Sorry, but what you showed didn't worked at all. Check out the authentication lib of streamlib. The function requires a completely different format of the credential then you showed...
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Read the pinned post, thanks!
@MStConsultancy
@MStConsultancy 2 жыл бұрын
@@CodingIsFun Post a new video since your current instruction is pretty missleading.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@MStConsultancy ok boss!
@pmshadow
@pmshadow 2 жыл бұрын
@@CodingIsFun thanks for the video and remember: don't feed the trolls :)
@PollynzDataTech
@PollynzDataTech 2 жыл бұрын
Thank youfor the well detailed video. I tried it but I am getting this error "TypeError: __init__() got multiple values for argument 'cookie_expiry_days" can anyone help me please. Thank you
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching. Please have a look at the pinned comment.
@diegosantosmoto
@diegosantosmoto 2 жыл бұрын
👏👏👏🇧🇷🇧🇷🇧🇷
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thank you! Greetings to Brazil! 👋
@diegosantosmoto
@diegosantosmoto 2 жыл бұрын
@@CodingIsFun always a great content! Greetings from 🇧🇷 Brazil
@shakyaditasonawane6532
@shakyaditasonawane6532 Жыл бұрын
TypeError: Authenticate.__init__() got multiple values for argument 'cookie_expiry_days'???? what to do???
@CodingIsFun
@CodingIsFun Жыл бұрын
Please read the pinned comment. Thanks
@mohammadrasel1008
@mohammadrasel1008 2 жыл бұрын
TypeError: __init__() got multiple values for argument 'cookie_expiry_days' #whats the problem
@CodingIsFun
@CodingIsFun 2 жыл бұрын
I cannot replicate this error. Everything works as expected when I clone the Github repo and run the project with the version specified in the requirements.txt file.
@estudandodados
@estudandodados 2 жыл бұрын
@@CodingIsFun the same error with me Authenticate.__init__() got multiple values for argument 'cookie_expiry_days'. I believe the signature was different from method Authenticate(credentials: dict, cookie_name: str, key: str, cookie_expiry_days: int = 30, preauthorized: list = None)
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@estudandodados Thanks for watching. Shortly after releasing the video, the package got updated and is not compatible with the syntax I have shown in the video. If you want to follow along with the video, please use version 0.1.5 👉 "pip install streamlit-authenticator==0.1.5"
@KumarHemjeet
@KumarHemjeet 2 жыл бұрын
@@CodingIsFun It would be great if you make the updated video on this.
@CodingIsFun
@CodingIsFun 2 жыл бұрын
@@KumarHemjeet Agree, but I might wait until this package is more stable. Otherwise, I might end up updating videos after every major release
@oumaimaechbicheb8605
@oumaimaechbicheb8605 2 жыл бұрын
hey , Great video thank u i was looking for this. I wonder if i could contact you , i have some questions to ask. thank u
@CodingIsFun
@CodingIsFun 2 жыл бұрын
Thanks for watching. I have already received your email.
Streamlit Elements You Should Know About in 2023
14:31
Mısra Turp
Рет қаралды 113 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
I Tried Adding Google Auth To a Streamlit App (It Didn't Go Well)
18:17
Fanilo Andrianasolo
Рет қаралды 5 М.
Build a Python Website in 15 Minutes With Streamlit
18:37
Tech With Tim
Рет қаралды 96 М.
How to Convert a Streamlit App to an .EXE Executable
8:20
Fanilo Andrianasolo
Рет қаралды 53 М.
My Workflow for Building any Streamlit Dashboard Project
9:40
Fanilo Andrianasolo
Рет қаралды 109 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН