Тёмный

Python Flask Authentication Tutorial - Learn Flask Login 

Arpan Neupane
Подписаться 11 тыс.
Просмотров 205 тыс.
50% 1

Hey guys! Welcome back! In this video, I show you how to build a login authentication system using Flask and Python. We'll be using Flask-Login to build it.
If you don't know about Flask or if this is your first time using it, Flask is a Python web framework that is used to create web applications. Flask has a built-in login system that can be used to authenticate users. The login system in Flask is very simple and only requires a user to enter their username and password.
Mac Command - pip3 install flask flask_sqlalchemy flask_login flask_bcrypt flask_wtf wtforms email_validator
Windows Command - pip install flask flask_sqlalchemy flask_login flask_bcrypt flask_wtf wtforms email_validator
Code: github.com/arpanneupane19/Pyt...
My Website - arpanneupane.com
My GitHub: github.com/arpanneupane19
Official Flask-Login Docs - flask-login.readthedocs.io/en...
My Programming Gear :
Keyboard: amzn.to/42vXkxh
Laptop: amzn.to/3CkAP3W
Laptop Stand: amzn.to/3X116Oi
Desk: amzn.to/43wmIEt
Monitor: amzn.to/42BAaFH
Monitor Arm: amzn.to/3NR0APS
Chair: amzn.to/42vvKAn
Desk Mat/Mousepad: amzn.to/43AhKqj
Microphone: amzn.to/45RuQ43
Headphones: amzn.to/445sf4R
#Python // #Flask // #LearnToCode

Наука

Опубликовано:

 

11 мар 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 462   
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
For people wondering where the code is in this video, you can find it here: github.com/arpanneupane19/Python-Flask-Authentication-Tutorial
@iancorrea3151
@iancorrea3151 2 года назад
Can i request a tutorial about React and Flask Authentication? Thank you.
@k.c.9019
@k.c.9019 2 года назад
That's not the same code. Code in github doesn't have at least check_password_hash part.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
@@k.c.9019 Thank you for reminding me. I hadn’t added a repo for this app when the video was made and saw many people requesting it so I decided to make one this month. Thanks for reminding me though.
@k.c.9019
@k.c.9019 2 года назад
@@ArpanNeupaneProductions Thank you for your work :)
@Jack__2
@Jack__2 2 месяца назад
​@@iancorrea3151 I am also making react + flask app have you make login and register page
@HassanRaza-cb3mz
@HassanRaza-cb3mz Год назад
I don't usually comment on videos, but WOW. This is the most simplest and most focused tutorial for this particular subject. You are doing great job man! loved the video.
@davidk7212
@davidk7212 Год назад
Straight to the point with no fluff, yet thorough and with every detail explained succinctly. And no cringey attempts at comedy. This is exactly what the world needs more of.
@SanSha2100
@SanSha2100 Год назад
What people are taking hours and still not able to illustrate, your focused approach teaches it minimum time with maximum impact. Kudos to you and very well done.
@philippkeller5882
@philippkeller5882 2 года назад
Such a great tutorial. I like that you focussed on the bare minimum, no styling, no fancy databases, no long explanations. That got me going with login and forms in Flask
@wdblackout
@wdblackout 2 года назад
right! tutorial nowadays just focused on the number of minutes for the views.
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
Haha I appreciate it!
@Vangsguard
@Vangsguard 12 дней назад
@@wdblackout You are aware that you can just... skip those parts of the video right? Also if you don't like long explanations you might want to find a different career. Understand why you do what you do is the most important in this field. Doing it is one thing, understanding why is what's hard. If not everyone could be a programmer with ChatGPT.
@wdblackout
@wdblackout 12 дней назад
@@Vangsguard necroposting. this is two years already and too late for a debate. you just have a kitkat, take a break alright?
@h_0412
@h_0412 Год назад
One of the best tutorial I've ever seen. I really appreciate that you chose to explain your code instead of blasting some random music like some other tutorials nowadays. Thank you!
@21Gannu
@21Gannu 2 года назад
you made this so simple. kudos… I suggest making whole series on flask it will benefit many students…
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Thank you!!
@mithunchandrasaha403
@mithunchandrasaha403 8 месяцев назад
Very Nice Explanation,Sir.Needs More Tutorial from you.
@user-io9jh5rv4d
@user-io9jh5rv4d Год назад
Really liked the video. This is my first flask project. Understood many basic concepts. Thank you. The code is working.
@Onlyhousefr
@Onlyhousefr 8 месяцев назад
Great value tutorial, thank you so much !
@rahulsumbly7310
@rahulsumbly7310 Год назад
Hey, very nice and useful video 👍. Just one suggestion, make playlists on your channel for videos on same topic it will be easier for users to navigate videos on your channel
@arunkumarvaradala7139
@arunkumarvaradala7139 3 года назад
Really helpful, Explained with very clear, Thank you so much. keep doing Many more on Flask and Machine Learning too.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 3 года назад
of course!
@rarisenpai
@rarisenpai 2 года назад
I am now a new subscriber you make great content and am going to watch every video I can from now on😄
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
Welcome aboard!
@steamhackman
@steamhackman 2 года назад
Just to echo most other commenters, great tutorial and very concise. Got my app up and running. Thank you muchly.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Glad to have been able to help
@Oc3anWav3s
@Oc3anWav3s 2 года назад
Just found this video and I loved how well you described everything! You earned a subscriber. Could you possibly make a video trailing off this - when a user logs in with their username, it will display the dashboard based on their specific details?
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Thank you for the compliment! When they log in, you can do something like this in the HTML file: {{ current_user.username }}, etc.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
You can basically access the current_user object in Flask and use that to display certain details/properties about the current user that is logged in.
@jeanpeuplu3862
@jeanpeuplu3862 Год назад
Thank you so much, I use this at work and I am sooo grateful for this perfect tutorial! Thanks!!
@valeeswarank
@valeeswarank 2 года назад
Nutshell explanation and simple and super mini project.
@indranil
@indranil Год назад
Great video!!.. Slightly off topic, which vscode theme have u used?
@thesnedit5406
@thesnedit5406 7 месяцев назад
Thank you for this awesome tutorial! Can you please tell how to link it to an external database like MySQL ?
@edwardgyan9749
@edwardgyan9749 Год назад
thanks for all you do. your teaching is great and hope you continue to upload videos.
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
I’m glad I can help :)
@timewasterlee
@timewasterlee 8 месяцев назад
I‘ve watched a numbers of flask tutorials, but this one is the best one that express the core idea in such short time!!!
@harrisonshu634
@harrisonshu634 Год назад
Awesome straightforward tutorial thank you!
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
Glad it helped!
@allanmitala8104
@allanmitala8104 2 года назад
Man great video, I was struggling with a flask project but know am sure i can finish it. Thanks for the video.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Of course!
@rodrigomarchi9755
@rodrigomarchi9755 9 месяцев назад
Great tutorial. I just wish you had a more comprehensive tutorial as well, creating a production ready app with more complexities involved.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 9 месяцев назад
Great suggestion!
@milesthomas3317
@milesthomas3317 3 года назад
Really helpful, thanks so much.
@arnavghosh4242
@arnavghosh4242 Год назад
Great tutorial, but isn't it better to use UUID's instead of Incrementing Numbers for ID field?😄Great Tutorial, and I have Successfully Learnt Authentication in Flask in 26 mins.
@arjunpukale3310
@arjunpukale3310 Год назад
very simple and up to the point ❤
@gregkrakow872
@gregkrakow872 3 года назад
I like the simplicity of your approach. The app contains just what is needed and it is explained all in less than 30 minutes. Is the code available for this project?
@ArpanNeupaneProductions
@ArpanNeupaneProductions 3 года назад
Thank you so much! The code is currently not available yet, I will make a GitHub repository for it.
@susanadesoji671
@susanadesoji671 2 года назад
This is a great tutorial, very helpful
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Thanks!
@mallinlr123
@mallinlr123 9 месяцев назад
Hi Arpan, can you please write the code to reset the password, if they forgot the password.
@miguelfernandes657
@miguelfernandes657 2 года назад
Thank you very much! Simple and effective!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Glad you were able to learn something!
@jongolove6744
@jongolove6744 8 месяцев назад
The fact that you made this seem easy is actually impressive💡
@Mrtero100
@Mrtero100 Год назад
Thank you! For me i had some troubles with bcrypt.check_password_hash, bcrypt.generate_password_hash so i imported them from flask_bcrypt and used the directly like : hashed_password = generate_password_hash(form.password.data) of course your method is very good and works but incase some have my same problem this can be helpful
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
Thank you not only for watching the video but also for providing a solution to viewers who may have encountered a similar problem :) Greatly appreciated!
@Mackerr
@Mackerr Год назад
thank you for this, you saved my grade
@aniketkadukar7772
@aniketkadukar7772 2 года назад
Man, You're awesome. Thanks!!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
You’re welcome!
@bapakkoding712
@bapakkoding712 Год назад
I like this video, from this i learn more about how apache superset workflow. thank`s its should be good if there`s tutorial for flaskapp-jwt-extender. nice work.
@EpicNerdify
@EpicNerdify Год назад
Hi sir, at 14:00 when i try to do import , i get this error ModuleNotFoundError: No module named 'flask', does anyone know of a fix for this? i have installed every necessary flask pip install modules
@Zaidibeth
@Zaidibeth Год назад
Hey arpan, thanks for your video. I would like to know, before trying the sqlite command, should I have sqlite previously installed in my system? I'm sorry if it seems obvious, but I have to ask.
@Zaidibeth
@Zaidibeth Год назад
Installed sqlite as shown in this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-BomCx0jbwPY.html
@joao.morossini
@joao.morossini 11 месяцев назад
Thank you! That was really helpful
@kamutabung511
@kamutabung511 8 месяцев назад
most simplest tutorial ever i watched, yet effective, super best tutorial
@khurshidbekkk2647
@khurshidbekkk2647 3 месяца назад
Your explanation is so plain and understandable. Thank you very much. You have just earned another follower!
@Bob-kq6gt
@Bob-kq6gt Год назад
dont you need sessions to keep being logged in? Also my I mirror what you write and my database does not work.
@rangabharath4253
@rangabharath4253 Год назад
Awesome as always 🙂
@KeesFluitman
@KeesFluitman Год назад
omg. im 35 and trying to get into IT, some basic Devops and programming and then I see you so perfectly explaining this. I wish i was 15 again. But Im trying to get it working with flask-ldap3 and flask-security as well. So I can use the groups as roles. Somehow got some annoying issues with that though. Are there actually still apps or websites that store user information on their on databases out there? Isnt everything Oauth these days, or backed by an ldap?
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
That depends on the auth system the website uses. OAuth is newer and is used if you want to avoid building your own system. This video was just for beginners to build their own system with Flask. Glad to hear the positive comments! Wishing you great luck for the upcoming career!! Good luck :)
@KeesFluitman
@KeesFluitman Год назад
@@ArpanNeupaneProductions thanks. Im still a bit overwhelmed by the sheer amount of possibilities in flask. I have my own ldap backend with freeipa so im trying to retrieve the users there, authenticate them, store their username and group and then allow certain areas of my website. So users can comment on my blog posts, and admins can post etc. But it's getting quite complicated and sometimes some things magically stop working haha.
@paulkang2806
@paulkang2806 Год назад
Hey Arpan, thanks for the great video. I have a quick question: when the user is logged out, how do we manage the security of the other html pages (this case dashboard.html)? lets say the user logged in and got redirected to the dashboard, clicks logout ->back to login page, but lets say user pressed backspace to force go into previous page (which is dashboard.html). Will the app show the dashboard html? or is there any forbidden/404.html?
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
I believe in the video I used the @login_required decorator which will only allow you to access a page if logged in. So to answer your question, they will not be able to.
@paulkang2806
@paulkang2806 Год назад
@@ArpanNeupaneProductions I just tried by myself with my flask app. it automatically redirects to the login page even if i try forcing it. thanks!!!
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
@@paulkang2806 Glad to help!!
@Andreasstanca95
@Andreasstanca95 9 месяцев назад
Amazing content but I get stuck at some point. when I want to db.create_all() in my terminal, I get the following error: RuntimeError: Working outside of application context. Any ideas how to solve this?
@end_player4032
@end_player4032 7 месяцев назад
i have the same problem
@NM_kawaii
@NM_kawaii 8 месяцев назад
I am facing problem in the database part. It says "The file is not displayed in the text editor because it is either binary or uses an upsupported text encoding" in vscode. Please help.
@its_just_me9
@its_just_me9 5 месяцев назад
use sqlite3 to acces it type in the terminal sqlite3 name_of_you're_database.db then type .schema to see if the tables are created
@habuugames8116
@habuugames8116 7 месяцев назад
how can i do it in mysql database?
@christiannahas2142
@christiannahas2142 2 года назад
is it possible to add in the def register(): function a connection, cursor, and cursor.execute(INSERT...) to save the data entered in the register into a sqlite3 data base that is already created? Because when i tried that the data was not saving in the database.
@juanmitilo2668
@juanmitilo2668 2 года назад
Excellent video. Thank you so much.
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
You are welcome!
@dope166
@dope166 11 месяцев назад
The validate_username function in register form, you haven’t called it anywhere in the app, how does it work? Is it called automatically?
@HLD202
@HLD202 2 года назад
Hello, I have a short question that you didn't cover it in your video, [20:55]: what is form.hidden_tag() use for?
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
CSRF token
@Drinkyoghurt
@Drinkyoghurt Месяц назад
I'm having issues with it setting up the DB file. for some reason it won't take. If I add a create_tables function it creates one in instance, but then doesn't seem to access it. Every time I submit my form it just reloads instead of taking the data I submitted
@geoffreyfouvry6094
@geoffreyfouvry6094 Год назад
On a scale of 10, you got 11.5... Just one thing: Don't forget the .decode('utf8') in the line............ hashed_password = bcrypt.generate_password_hash(form.password.data).decode('utf8')
@BaoNguyendarkmatter820
@BaoNguyendarkmatter820 6 месяцев назад
At 13:18, I had to put line 7 and 8 (appp.config) before db=SQLAl to resolve a runtime error.
@danielfaran5783
@danielfaran5783 5 месяцев назад
thanks for the info
@idosarue5054
@idosarue5054 2 года назад
Awesome video! thank you so much!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
You’re welcome!
@waynelei2187
@waynelei2187 11 месяцев назад
Hi, any idea how to setup the expiry or duration for he the cookie? Thank you! I think it should have something to do with the login_user method, but I am not able to make it work
@atakankaraman4005
@atakankaraman4005 Год назад
hello, i got an error message when i import library as a "from flask_wtf import FlaskForm" i received an error. ImportError: cannot import name 'url_encode' from 'werkzeug'. i've installed all library from requirements.txt with same version my python version is 3.10. pycharm version is 2022.3.1. what is your python version could you please help me
@peya02
@peya02 10 месяцев назад
What steps should I do to deploy the app on a hosting? I'm trying and I get internal server error. You don't like something about the login part.
@Yu-xl8qs
@Yu-xl8qs 2 года назад
You're awesome. Thank you!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
You're welcome :)
@ChanderMohan-lj9dy
@ChanderMohan-lj9dy Год назад
Hi, I'm getting this error "sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: user" when I try to register any name and am not able to solve the issue. Any assistance is greatly appreciated.
@himanshuS1718
@himanshuS1718 9 месяцев назад
I am getting "Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set" this error. can somebody help me?
@LittledoubleU
@LittledoubleU 4 месяца назад
Is there a way to make required admin system??? I already used current_user.is_authenticated to check if the user already sign in they will see and use some specific part for login users, but I want to made some function required admin role, even you already login you can't use. (Sorry for the grammar 🙏 English is not my main language.)
@cecilia7348
@cecilia7348 Год назад
Wow. Well explained
@ritikthakur6270
@ritikthakur6270 Год назад
Hi Great tutorial. How to restructure the code in different directories ?
@eddie4249
@eddie4249 Год назад
Awesome tutorial!
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
Thanks!
@alwinjames4777
@alwinjames4777 Год назад
showing this error at 14:41 >>> from app import db Traceback (most recent call last): File "", line 1, in File "C:\Users\User\Desktop\flask-auth\app.py", line 5, in db = SQLAlchemy(app) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\flask_sqlalchemy\extension.py", line 219, in __init__ self.init_app(app) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\flask_sqlalchemy\extension.py", line 301, in init_app raise RuntimeError( RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set. can you please help me
@person....4169
@person....4169 Год назад
lol, I got the same issue did you find a solution?
@dakshitha1
@dakshitha1 Год назад
Awesome tutorial, can I use this with React as front-end?
@ArpanNeupaneProductions
@ArpanNeupaneProductions Год назад
You can use Flask for the backend, however, it's not the same process when it comes to logging in. Here, we're using Flask login because we're using Flask as the backend API and HTML as the frontend. For React, I'd suggest you watch this video I made: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7LNl2JlZKHA.html
@martezcarmouche3179
@martezcarmouche3179 9 месяцев назад
HEELLLPMy flask isn't working. When I hit run it gives me error "not recgnized as the name of cmdlet....". Can some one help!
@okwuteizuchukwu7547
@okwuteizuchukwu7547 9 месяцев назад
Hello all, I get as far as 12:03 but then I find that I get this error 'RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set.' Can anyone help? (ps. compared to other tutorials on the topic this one is the best I have found so far. Thank you for taking the time to put it together)
@saraimarte
@saraimarte 9 месяцев назад
same im stuck there too
@jbe52w25
@jbe52w25 3 месяца назад
this is a version different in how SQL Alchemy treats db definition or something just move the db = SQLAlchemy(app) line after the app.config lines
@MyselfGagan
@MyselfGagan 2 года назад
Hi , I Am "ValueError: Invalid salt" while validating the login inputs, I have tried everything from google but not able to resolve it, please help me out in this
@its_just_me9
@its_just_me9 5 месяцев назад
its a great tuturial but i am lost at the classes of the form can we do this without them ?? can we just type it in html ??
@Unwired182
@Unwired182 2 года назад
Thanks a lot for the video very helpful and well explained! I having an issue with url_for, when signing up its not taking me to login, when login in its not taking me to dashboard, etc. Do you know why could that be? Thanks!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
Can you share the code ?
@Ahdem897
@Ahdem897 2 года назад
@@ArpanNeupaneProductions having the same problem, any luck with it?
@kislaysinha9772
@kislaysinha9772 2 месяца назад
very nice tutorial, thanks a lot
@user-yh4lt6ew1o
@user-yh4lt6ew1o 3 месяца назад
Bro you are highly talented with your age
@azyjmexcuseokstop924
@azyjmexcuseokstop924 Год назад
shouldnt the password be hashed from the client side ? as it is, the password still goes on the network uncrypted, and is only crypted when it enters the post function, server side, no ?
@davidbidzhoian1527
@davidbidzhoian1527 Год назад
Well, I got ValueError: Password must be non-empty of bcrypt.generate_password_hash(form.password.data). I run the same code as you posted. What's wrong?
@bloomerboi21
@bloomerboi21 3 года назад
Road to one million subscribers
@georgejuarez660
@georgejuarez660 Год назад
Nice video, but I would like to know one thing. I want the system to generate an error message (which is visible on the site) when the user in the registration puts the same email. Here I say how can I do?
@ammarbinmadi7175
@ammarbinmadi7175 Год назад
at 14:27 my Sqlite database file didn't contain any tables so i followed the following format #Unix/Mac (note the four leading slashes) sqlite:////absolute/path/to/foo.db #Windows (note 3 leading forward slashes and backslash escapes) sqlite:///C:\\absolute\\path\\to\\foo.db #Windows (alternative using raw string) r'sqlite:///C:\absolute\path\to\foo.db' in my Sqlite file link at line 7
@progger1050
@progger1050 2 года назад
I have a questions If I login I want to create a session but how to get the user name in the session because it is coming from the form
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
If you want to get the user’s name from the session, you can just do current_user.username.
@loere
@loere Год назад
There is a built in hash function in python called "hash" returns integer
@aestedits4150
@aestedits4150 Год назад
Hi thanks for this great tutorial. I am having a problem, "database.db" is not working for me, I have installed SQL all extensions but the problem is same still. Could you please help.
@baldoggie
@baldoggie Год назад
it is not working for me either
@adedayoadewale2509
@adedayoadewale2509 9 месяцев назад
after create_all user is not showing up after .tables
@ospfpacket
@ospfpacket Год назад
Hey Arpan, Absolutely great content! Thank you!!! At roughly 14 minutes, you import db from app. I must be missing something, because when I run that, it just tells me there is no module named app.... "from app import db" If I am following correctly, I need to do that step to actually create the database and table. Any insight you can provide, please?
@ospfpacket
@ospfpacket Год назад
I finally found another comment dealing with this. Importing the actual filename, not arbitrary 'app'. Should have caught that. Great stuff here. Thank you!
@binh
@binh Год назад
@@ospfpacket hi! can you give an example of the actual filename?
@person....4169
@person....4169 Год назад
@@ospfpacket could you explain more?
@PrashantSingh-pw1ze
@PrashantSingh-pw1ze Год назад
@@binh see it's like this import it using your file name, don't use the one that he has used like my file name is host.py so it goes like this -- from host import db so in general it looks like this -- from "file-name" import db
@PrashantSingh-pw1ze
@PrashantSingh-pw1ze Год назад
@@person....4169 see it's like this import it using your file name, don't use the one that he has used like my file name is host.py so it goes like this -- from host import db so in general it looks like this -- from "file-name" import db
@kevinrodriguez-zk5kq
@kevinrodriguez-zk5kq Год назад
Hi! I'm having the message error for Either SQLALCHEMY_DATABASE_URI nor SQLALCHEMY_BINDS is set after I try to import db. Is this something outside of this tutorial? I am unsure as to why it continues to pop up.
@moazali4757
@moazali4757 5 месяцев назад
You might want to move the creation of the db object after configuring the database URI. It will solve this problem. Here's how you can modify your code: app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db' # Move the configuration here app.config['SECRET_KEY'] = 'thisisasecretkey' db = SQLAlchemy(app) # Initialize the db object after configuring the app bcrypt = Bcrypt(app) Copy this code, and replace with previous lines of code.
@SomeoneSexy
@SomeoneSexy Год назад
I am having trouble with connecting to the database, when I run sqlite3 database.db, it says "the term sqlite3 is not recognized..." Not sure what I did wrong because I followed the same as your video. Send help pls! thanks!
@neuralclass
@neuralclass Год назад
Nice tutorial!
@JohnWick-fs8bc
@JohnWick-fs8bc Месяц назад
Hey, You have an MIT license and i was confused, because you don't license it in your video. If i use this code for my website, do i need to somehow license it?
@ArpanNeupaneProductions
@ArpanNeupaneProductions Месяц назад
MIT License is just to specify that you can use the code freely but I am not liable for any issues.
@JohnWick-fs8bc
@JohnWick-fs8bc Месяц назад
@@ArpanNeupaneProductions Thanks for the fast response. But do I have to include it in my site
@ArpanNeupaneProductions
@ArpanNeupaneProductions Месяц назад
@@JohnWick-fs8bc That's up to you
@kurty85
@kurty85 2 месяца назад
I did all the steps and they worked perfect but I am having an issue adding more routes to the home page for "about, cloud, etc". The routes simply do not appear when added. Anyone experience this?
@italobuitron1165
@italobuitron1165 Год назад
I have a question with the @login_manager.user_loader def load_user(user_id): return User.query.get(int(user_id)) 1. When you log, the USERNAME is passed as user_id into load_user(user_id), right? then, 2. you use a User.query... (what i supposed is a query from Sql) which return the ID (in the DB) from the USERNAME So, if you use current_username.get_id() it return whatever u return from load_user(), in this case the ID from the query? is it?
@pent9157
@pent9157 3 года назад
really helpful thank you
@ArpanNeupaneProductions
@ArpanNeupaneProductions 3 года назад
you're welcome!
@johnlloydfrancisco3401
@johnlloydfrancisco3401 2 месяца назад
hello sir can you help me with my web app using flask, i need to create a point of sale for a pharmacy.
@RocketLR
@RocketLR Год назад
is it just me or did u forget to show the part where u filled in the forms action attribute? I cant find it where you put that info in..
@ghobashi2000
@ghobashi2000 2 месяца назад
شكرا على هذا الفيديو المفيد والسهل في الفهم أيضا
@bharathmuthyala7608
@bharathmuthyala7608 5 месяцев назад
Hi, I have been getting a runtime error and tried many ways to correct it, but still unable to get it resolved. Can someone please guide me on this. RuntimeError: Either 'SQLALCHEMY_DATABASE_URI' or 'SQLALCHEMY_BINDS' must be set.
@elie1943
@elie1943 11 месяцев назад
Very helpful thank you
@PS3PCDJ
@PS3PCDJ 5 месяцев назад
Amazing tutorial
@casualcomputer6544
@casualcomputer6544 2 года назад
Great video. A question: after I ran "db.create_all()" and checked for ".tables", I noticed that "user" is not there. What do you think is wrong with my execution?
@casualcomputer6544
@casualcomputer6544 2 года назад
Actually, I made a typo in earlier codes: I should have copied "SQLALCHEMY_DATABASE_URI" instead of "SQLALCHEMY_DATABASE_URL" Problem solved. Thanks!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
@@casualcomputer6544 Sweet!
@casualcomputer6544
@casualcomputer6544 2 года назад
@@ArpanNeupaneProductions Very interesting content! Just curious, do you have some resources on the deployment of python web apps that require login? If find your content super helpful!
@ArpanNeupaneProductions
@ArpanNeupaneProductions 2 года назад
@@casualcomputer6544 Yeah! I have a video on how to deploy a Flask app to Heroku which can be found here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-D2GLVoiEZyE.html
@zsirothehero4330
@zsirothehero4330 Год назад
I have the same problem but it doesnt work even tho my URI is right. What is wrong?
@aleksahadzic9302
@aleksahadzic9302 Год назад
For people who already know how to set up the flask app, you can start watching from 9:40
Далее
User Authentication - Flask Tutorial Series #8
28:14
Просмотров 4,4 тыс.
User Login with Flask_Login - Flask Fridays #22
23:51
Secure Login System in Python
14:43
Просмотров 96 тыс.
Authentication and Authorization With Flask-Login
35:20
Nokia 3310 versus Red Hot Ball
0:37
Просмотров 995 тыс.