How to Add a User Authentication Service (Login Form) in Streamlit
👉 Explore All My Excel Solutions: pythonandvba.com/solutions
𝗗𝗘𝗦𝗖𝗥𝗜𝗣𝗧𝗜𝗢𝗡
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
In this video, I will show you how to add a user authentication service (login form) in Streamlit so that your users can log in and see the content of your streamlit app. To implement the user authentication, we will use the ‘streamlit-authenticator’ library, a secure authentication module to validate user credentials in a Streamlit application.
🌍 𝗟𝗜𝗡𝗞𝗦:
▶ Demo Website: www.dashboarduserauth.pythona...
▶ Streamlit-Authenticator library: github.com/mkhorasani/Streaml...
▶ Example files from this video: github.com/Sven-Bo/streamlit-...
⭐ 𝗧𝗜𝗠𝗘𝗦𝗧𝗔𝗠𝗣𝗦:
00:00 - Introduction
00:33 - Create the helper file
02:43 - Implementation in the streamlit app
06:36 - Closing words
𝗧𝗢𝗢𝗟𝗦 𝗔𝗡𝗗 𝗥𝗘𝗦𝗢𝗨𝗥𝗖𝗘𝗦
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
🆓【𝗙𝗥𝗘𝗘】Excel Add-in (𝗠𝘆𝗧𝗼𝗼𝗹𝗕𝗲𝗹𝘁): pythonandvba.com/mytoolbelt
📊 Data Visualization Excel Add-In (𝗚𝗿𝗮𝗳𝗹𝘆): pythonandvba.com/grafly
🤪 Fun Emoji Excel Add-In (𝗘𝗺𝗼𝗷𝗶𝗳𝘆): pythonandvba.com/emojify
📑 Excel Templates: pythonandvba.com/go/excel-tem...
🎓 My Courses: pythonandvba.com/go/courses
📚 Books, Tools, and More: pythonandvba.com/resources
𝗖𝗢𝗡𝗡𝗘𝗖𝗧 𝗪𝗜𝗧𝗛 𝗠𝗘
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
🔗 LinkedIn: / sven-bosau
📸 Instagram: / codingisfun_official
💻 GitHub: github.com/Sven-Bo
💬 Discord: pythonandvba.com/discord
📬 Contact: pythonandvba.com/contact
☕ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲?
If you want to support this channel, you can buy me a coffee here:
▶ pythonandvba.com/coffee-donation
Пікірлер: 252
🚨 *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: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html *Happy Streamlit-ing!* 🎉
@mikekaspari1357
Жыл бұрын
Great. Does this work with the homepage function you have shown last week?
@mikekaspari1357
Жыл бұрын
Hi Sven, I tried by myself. It worked
@GidonLoewenberg
Жыл бұрын
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
Жыл бұрын
any plans of updating the video to the newest version?
@CodingIsFun
Жыл бұрын
@@poseidon907 Once the package is more stable, I might do another video.
Thanks for making these useful tutorials, Sven. You teaching style makes everything look simple and clear!
@CodingIsFun
11 ай бұрын
*I am glad to hear you are enjoying them, thanks for watching and for the comment!*
I only discovered your channel today. What a gem ! Keep up the good work, mate
@CodingIsFun
Жыл бұрын
Welcome aboard! Glad you like the videos! Thanks for watching and taking the time to leave a comment! 🤩
one year later, but still gold! Thanks a lot :)
@CodingIsFun
Жыл бұрын
Thanks for the kind words. Glad you liked the video! :)
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
2 жыл бұрын
Thank you!
Wow, just discovered the channel and already found several solutions of my problems. Thank you for your work
@CodingIsFun
Жыл бұрын
I'm so happy to hear that you've found the videos useful! Thanks for watching and taking the time to leave a comment!
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
Жыл бұрын
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! 👍
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
2 жыл бұрын
Thanks for your sub & welcome aboard!
Awesome video as always, thanks for the useful content 👌
@CodingIsFun
2 жыл бұрын
Thank you! :)
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
2 жыл бұрын
Thanks for watching and your comment!
@CodingIsFun
2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
Congrats on 20k subs man
@CodingIsFun
2 жыл бұрын
Thanks a lot! :) 🎉
Such clear and succinct instruction. Thank you!
@CodingIsFun
3 ай бұрын
Glad I could help! Thanks for watching and for the kind words. Cheers, Sven ✌️
Yes please, can we have a tutorial on storing users in a db?
@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
2 жыл бұрын
Yes please!
@barryvorster4696
2 жыл бұрын
Yes please
@chriskeo392
Жыл бұрын
Yup I vote too
@amsathsherif659
6 ай бұрын
@@CodingIsFunyes please sir
Great tutorial. It would be awesome if you make one about how to store the passwords in a database!
@CodingIsFun
2 жыл бұрын
Thank you & well noted!
@michalfrankowski5328
2 жыл бұрын
I am with you on that! It would be cool to know that.
@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
2 жыл бұрын
@@dishangmehta4397 Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
Very useful, thank you!
@CodingIsFun
2 жыл бұрын
Happy to hear that you find it helpful. Thanks for watching and your comment!
That was great. Good Job.💪
@CodingIsFun
Жыл бұрын
Glad you liked it. Thanks for watching and taking the time to leave a comment!
Another great video. Dankeschön! Yes, please can we have a video on storing hashed passwords in a DB :o)
@CodingIsFun
2 жыл бұрын
Danke! Well noted! :)
@CodingIsFun
2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
Great video, this is very helpfull !
@CodingIsFun
Жыл бұрын
Thank you! 👍
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
2 ай бұрын
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 ✌️
Thank you for creating such cool tutorials, have you uploaded any tutorials on how to store user info in a database?
@CodingIsFun
10 ай бұрын
Thanks for watching. Yes, I have and I have also seen, that you found it already ;) kzread.info/dash/bejne/l3eWqpSngK-fo7g.htmlsi=PNGbDS_5rPJIhy9V
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
Жыл бұрын
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
Жыл бұрын
@@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!
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
10 ай бұрын
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! :)
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
2 жыл бұрын
Well noted :)
@CodingIsFun
2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
thank u for the helpful tutorial
@CodingIsFun
Жыл бұрын
Happy to hear that it was helpful; thank you for taking the time to leave a comment and for watching the video!
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
11 ай бұрын
Thanks for watching. You might want to check the documentation of the package and/or create an GitHub issue: github.com/mkhorasani/Streamlit-Authenticator
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
2 ай бұрын
As far as I know, this is not natively supported.
Many thanks!!!!
@CodingIsFun
Жыл бұрын
You're very welcome! Thank you for watching and for the comment!
As always, excellent video and I’m curious to see how it works with storing the password in a database.
@CodingIsFun
2 жыл бұрын
As always, thanks for watching! :)
@CodingIsFun
2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
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
Жыл бұрын
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!
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
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.
Loved it
@CodingIsFun
Жыл бұрын
Glad you liked it. Thanks for watching.
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
Жыл бұрын
Thanks for watching. I have not tried it with a multipage app yet, sorry!
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
2 жыл бұрын
Thanks for watching. Not that I know of 😕
Amazing content, please create tutorial on storing user details in a database
@CodingIsFun
2 жыл бұрын
Thanks! I am already working on that tutorial. Stay tuned! :)
@CodingIsFun
2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
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
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!
Vielen Dank ❤
@CodingIsFun
11 ай бұрын
Danke fürs Anschauen! :)
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
Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
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!
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
Жыл бұрын
Thanks for watching. Please check out the pinned comment
@peakpointforex
Жыл бұрын
@@CodingIsFun Thank you 👍
@peakpointforex
Жыл бұрын
The new version of streamlit works now. Thank you so much 🙂
🔥 🚀
@CodingIsFun
2 жыл бұрын
🚀🚀🚀
very good
@CodingIsFun
Жыл бұрын
Glad to hear you liked it! Thank you for commenting and watching.
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
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.
Hi bro. Good video. How did you change the UI of login page?
@CodingIsFun
10 ай бұрын
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!
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
5 ай бұрын
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
5 ай бұрын
@@CodingIsFun Thank you!
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
10 ай бұрын
Thanks for watching. Not sure how to implement that
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
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
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
Жыл бұрын
Thanks for watching. Kindly have a look at the pinned comment.
@InteligenciadeNegocios
Жыл бұрын
@@CodingIsFun Thank you! Now is working! excellent content!
thank your
@CodingIsFun
Жыл бұрын
Thank you for your comments under my video. I appreciate your support! :)
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
10 ай бұрын
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
10 ай бұрын
@@CodingIsFun ok thank you very much for your prompt reaction
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
2 жыл бұрын
Thanks for watching the video & your video suggestion.
👍🏻
@CodingIsFun
Жыл бұрын
👍👍
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
6 ай бұрын
Thanks for watching and your video suggestion.
@srilaxmip9
6 ай бұрын
@@CodingIsFun Do you know any streamlit packages which can serve this purpose?
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
Ай бұрын
Thanks for watching. Hard to tell from a distance. Cheers, Sven ✌️
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
Жыл бұрын
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!
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
2 жыл бұрын
Thanks for watching the video & your suggestions!
@CodingIsFun
2 жыл бұрын
Please find the tutorial on how to store the usernames & passwords in a database here: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
@abhishekbhosale3628
2 жыл бұрын
@@CodingIsFun Thank you so much
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
5 ай бұрын
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
5 ай бұрын
@@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!!!
Well done 🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰🥰
@CodingIsFun
9 ай бұрын
Thanks! 😍
@codingisfun can you make a new video for the latest version of the streamlit?
@CodingIsFun
11 ай бұрын
Thank you for watching the video & your suggestion.
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
Жыл бұрын
At which part of the video (timestamp) and which line number?
@mastoring
Жыл бұрын
@@CodingIsFun it refers to the line 26, timestamp is 4:14
@CodingIsFun
Жыл бұрын
@@mastoring please ensure to use version 0.1.5 and try again (as written in the pinned comment)
@ordaflash
Жыл бұрын
Hello, i got the same Error, what did you do to resolve it please ?
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
Жыл бұрын
Never mind, I fixed it
@CodingIsFun
Жыл бұрын
Thanks for watching. Glad you fixed it.
@villeolof2000
Жыл бұрын
@@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
3 ай бұрын
@@sandhupb02 I didn’t. So if you ever fix it, please let me know how. 😀
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
7 ай бұрын
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
7 ай бұрын
Ok thanks@@CodingIsFun
Bro I have a question . Plz answer . Does streamlit works with cpanel ?
@CodingIsFun
2 жыл бұрын
As far as I know, it doesn't.
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
Жыл бұрын
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
Жыл бұрын
Nevermind, It worked. Thanks!
@CodingIsFun
Жыл бұрын
@@sohamsinha3419 how did you solve it?
@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).
__init__() got multiple values for argument 'cookie_expiry_days' how to solve this error sir
@CodingIsFun
Жыл бұрын
Check out the pinned post
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
4 ай бұрын
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.
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
Жыл бұрын
Thanks for watching and for your question. Hard to tell from a distance why you are facing an error. Sorry that I cannot help.
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
Жыл бұрын
Sorry, but I cannot replicate this issue. Usually, the login credentials should be stored in a cookie, as explained in the video.
@JaidMirajkar
Жыл бұрын
@@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
Жыл бұрын
@@JaidMirajkar As far as I know, there is not fix to this issue
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
Жыл бұрын
Please try " pip install streamlit-authenticator==0.1.5 --user"
@bomb143
Жыл бұрын
@@CodingIsFun oh it worked. Thanks
Supar
@CodingIsFun
7 ай бұрын
Thanks! :)
I have a streamlit_autheticator problem, could anyone help me? KeyError: 'usernames'
@CodingIsFun
5 ай бұрын
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
5 ай бұрын
thank you very much! I managed to make it work..
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
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
2 жыл бұрын
@@CodingIsFun greats, now it works well. Thank you, sir.
@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
2 жыл бұрын
@@ahmedsayed7138 Did you include it in the requirements.txt file?
yes how about tutorial on connectiong to database for passwords
@CodingIsFun
Жыл бұрын
Here you are: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
It says streamlit-authenticator has no attribute 'hasher' What to do ?
@CodingIsFun
3 ай бұрын
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
2 ай бұрын
Can you make another vid of the same topic with the updated version?@@CodingIsFun
How to create that pickle file ?
@CodingIsFun
6 ай бұрын
Thanks for watching. I have shown that in the video. Kindly rewatch it! :)
@Lyricverse116
6 ай бұрын
@@CodingIsFun thank you
thank you for the video very useful but it works just with streamlit-authenticator==0.1.5
@CodingIsFun
7 ай бұрын
Thanks for watching. That is correct (as stated in the pinned comment) :)
is there any option for forgot password or reset password?
@CodingIsFun
Жыл бұрын
Yes, with the new release: github.com/mkhorasani/Streamlit-Authenticator#4-creating-a-password-reset-widget
@prasadsaitavadekar
Жыл бұрын
@@CodingIsFun Small video on this would be great, Thank You.
@CodingIsFun
Жыл бұрын
@@prasadsaitavadekar If I find the time, I will do it
@psg3127
Жыл бұрын
@@CodingIsFun i cannot make this work so indeed it would be fantastic to have a video on this. thanks !
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
Жыл бұрын
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
Жыл бұрын
@@CodingIsFun Thank you
something is off here, the code does not match the current state of streamlit design
@CodingIsFun
Жыл бұрын
Please read the pinned comment, thanks
facing script runner error how to resolve ?
@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
Жыл бұрын
@@CodingIsFun Can you write an erp software code for me for student employee management system
@CodingIsFun
Жыл бұрын
@@sushilmudgal203 Nope, sorry
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
Жыл бұрын
Thanks for watching. Please have a look at the pinned comment.
👏👏👏🇧🇷🇧🇷🇧🇷
@CodingIsFun
2 жыл бұрын
Thank you! Greetings to Brazil! 👋
@diegosantosmoto
2 жыл бұрын
@@CodingIsFun always a great content! Greetings from 🇧🇷 Brazil
i did all the steps but says inccorect password even thou is the correct one
@CodingIsFun
Жыл бұрын
Hard to tell from a distance. Sorry, that I cannot help you.
@TheAlucarb
Жыл бұрын
@@CodingIsFun thanks anyways, i belive is the pickle file maybe the program is not reading it
Great video. I don't know how to reset the password and update it to hashed_pw.pkl ' file?
@CodingIsFun
Жыл бұрын
Thanks for watching. Please check out the provided examples on GitHub: github.com/mkhorasani/Streamlit-Authenticator Happy Coding!
@thanglt
Жыл бұрын
@@CodingIsFun Thank you very much!
i wish you could use a database because in real world, users are in the database
@CodingIsFun
Жыл бұрын
Thanks for watching. Here you are: kzread.info/dash/bejne/l3eWqpSngK-fo7g.html
How to add logout bro….
@CodingIsFun
Жыл бұрын
It's explained in the video
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
Жыл бұрын
Read the pinned post, thanks!
@MStConsultancy
Жыл бұрын
@@CodingIsFun Post a new video since your current instruction is pretty missleading.
@CodingIsFun
Жыл бұрын
@@MStConsultancy ok boss!
@pmshadow
Жыл бұрын
@@CodingIsFun thanks for the video and remember: don't feed the trolls :)
TypeError: Authenticate.__init__() got multiple values for argument 'cookie_expiry_days'???? what to do???
@CodingIsFun
Жыл бұрын
Please read the pinned comment. Thanks
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
2 жыл бұрын
Thanks for watching. I have already received your email.
TypeError: __init__() got multiple values for argument 'cookie_expiry_days' #whats the problem
@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
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
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
2 жыл бұрын
@@CodingIsFun It would be great if you make the updated video on this.
@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