omg this is such a great tutorial!! i wasted 2 days trying to make my post/get methods work and was about to give up haha but fortunately i found this video! thank you for such a clear explanation!!!
Unbelievably helpful. Watched a few of these videos and I feel like I learned a ridiculous amount in just one day. Went from 0 knowledge of HTML and flask with basic python to feeling like I can make any website lol
Exactly what I needed for an example of how to use an HTML form with flask. I really appreciate how you provide a simple example and keep it to around 10 minutes. Thanks man, I'm trying to do my college homework for Python class and this was great.
I just watched this video 3 times to figure out that my post method wasnt working because I put "methods" in the html form attribute instead of "method".....i love coding so much
Your videos are very user-friendly and easy to follow along with! You have helped me more than I could say! Thanks for all your hard work and dedication!
I really wanna move onto the next video but I had to stop and comment and say how great these videos are. This is EXACTLY what I've been looking for! Thank you SO much! I'll be watching the videos in order, but hopefully you have a video the covers how to upload file to the server I can run functions on. If not maybe, you can make a video. It's something I've been stuck on for a while now. Thanks!!!
This video is great. I am a SQL developer, so python and HTML are a side gig for me. I was struggling with taking in input from a flask server and passing it to other functions but you have explained everything in a way that is both easy to understand and is translatable to my application's needs. Thanks so much!!!!
I did this because yes. I put some pride into my work and merged the RENDER_TEMPLATE function with a dictionary called CONTENTS that is basically configuration. Here is script Number 1 from flask import Flask, redirect, url_for, render_template from settings import contents def rendertemplate(name): return render_template(name, contents=contents) Here is script Number 2 contents = { "forListTest":["This", "is", "a", "test."], "title":"Trebla2" } Please note that this is super early on, so some of this is probably gonna change when i finish.
salamat dok sa inyo salamat sa pagtulong niyo pag-aalaga ay tapat at totoo maayos na kalusugan buong hangad kanino man sa bawat pilipino'y kayo ang takbuhan kaya't salamat dok sa pagtulong na lubos kalusugan namin naging maayos salamat dok sa inyo nakagabay lagi kayo impormasyong hatid laan sa bawat tao salamat dok sa inyo salamat sa pagtulong niyo pag-aalaga ay tapat at totoo maayos na kalusugan buong hangad kanino man sa bawat pilipino'y kayo ang takbuhan salamat dok (5x)
Tim, could you please make a Udemy course. I love your fantastic teaching style. Udemy makes it easier for us "third world" student to afford quality content. Much appreciation from South Africa! ™️💯
found a way to resolve this.. You have to parse the multiple parameters with the url (using javascript redirect option).. then when it has been redirected to your app route, then var 1 = request.args.get('your_param_name1') rvar 2 = equest.args.get('your_param_name2')
WARNING FOR BEGINNERS, MISTAKE AT THE BEGINNING OF THE VIDEO: a POST request is NOT more secure than a GET request. The information being sent in a POST request is hidden from the URL, and that is all. Anyone wanting to intercept the data being sent across the network could easily do so. While it is true that POST doesn't expose information via the URL, it exposes just as much information as a GET in the actual network communication between the client and server. If you need to pass information that is sensitive, your first line of defense would be to pass it using Secure HTTP. Not trying to knock your video Tim, just wanted to make sure that new user's don't try to send passwords and other sensitive data across the network using only a POST request.
No worries! Thank you for pointing that out as a few others have as well. This was a critical mistake on my part as I did not define what I meant by secure. I will be the first to admit when I make a mistake and this was a big one! Thankfully we have people like you who can point them out
@@TechWithTim Hi Tim - maybe you should make a little text overlay on that part of the video to explain since many people might dig through the comments. BTW, your tutorials kick serious a$$
I heard that isn't necessary (HTML works with and without "/"). However, if u want to have page compatibile with XHTML, u need all closing (/) tags, even in sth like input, br and img
I dont get it why do you have also and base.html and index.html, can you show them and what is difference between this 2, great video, but I am confused with 3 html files insed of 2
guys! its important. When you copy Navbar, CSS and JS you have to use version Bootstrap v4.3. Now at 2020 October its v 4.5 new version makes lots of problem when you try Login with method POST
@@MuffinologyTrainer dude shut up and be grateful. You wanna pay $400 for a shitty udemy course? Go ahead. Nobody wants you to just complain and discredit the guy for his work.
If you watch closely, you'll notice that Tim was explaining things correctly. His mistake was due to an honest error. When re-posting, he merely went too fast and didn't change the URL. Be nice. I commend him and anyone who gives of themselves. No need for the rudeness and crass comments/language.
It seems the browser re-did the last action which was a POST. If Tim did tape enter in the url bar, he would have get a GET method. Don't know if I'm clear, english is not my native linguage... :/
Hang, browsers repeat the last request they sent when they are asked to refresh a page. When the last request sent is a POST, when you refresh you get a POST again. A refresh would cause a duplicate form submission, which in almost all cases is not the desired action. For that reason, the browser asks for confirmation from the user (browser-pop-up message shown in the video). Many users do not understand this warning from the browser. Consequently, it is considered good practice for web applications to never leave a POST request as the last request sent by the browser. This is achieved by responding to POST requests with a redirect instead of a normal response. All these info comes from Miguel Grinberg's Flask Manual. I think your question was pretty clever and you didn't mean to "complain" or "discredit" Tim, whom by the way rocks at teaching. Have a good day!
I think that it is a kind of bad practice using "/" URL. What if your username will be equal to "login"? The better way is to use URL like "/user/" which will never collide with "/login" or any other pages we would have in the website root.
Great video. My doubt is that I need to send a value selected from a drop down as a GET parameter to my Flask backend. How do I do that? Here you used the function request.form[id] but I need to pass a variable (or parameter) which I would select from a dropdown list.
Dear bro Tnx for your video . I need to know how i can appear the captcha code in busy or overloaded sites when tis not shown captcha code ( just show the image box instead off captcha code) by get and post method.
Interestingly, I have left the re-route function from the previous video in the code and the POST, GET function re-route uses that one instead of the one I have created for it. Wonder why?
If you are getting the error 405 Method not allowed use the line methods = ["GET","POST"] on the @app.route wrapper seperated by a comma next to the subpage like so app.route("/login",methods=["GET","POST"]) fixed the problem for me
Good video! I thinking how to get that data from input and just print it in console (other purpose, than generating page - for example just adding something to db), I tried but without success. Maybe is super-easy and I am just to tired ..
Hey Tim can you make a tutorial for how to conect html,css,js with FLAK, and we should also be able to send and receive data in the json format, and I hope you use axios, or else you can use jquery and ajax.
Ok, wow, after a lot of struggle I was able to make this work. Phew! But I was actually trying something way more advanced, to obtain the inputs from drop down lists and print them on the screen. Tim, is it possible to print the value in the same main page? Right now in order to display the values I am needing to go to a new Url, which doesn't make sense. I want to display the values in the same page as the drop down menus (there are various of them).
7:09, after I login it comes with this error:werkzeug.routing.BuildError: Could not build url for endpoint 'harshi' with values ['usr']. Did you mean 'static' instead? plz help thanks
try doing the tutorial again, it's great as its only a 10-minute video, I don't know if over the past week you've resolved that problem but I'm 9 minutes in and I have no problems
@@tradingwithsujay for the redirect I put redirect to the user page but I put just put user, you have to put user in quotation marks because that's the page
If we need to transmit large data through a redirect, how can we do that? I encountered an 'ERR_RESPONSE_HEADERS_TOO_BIG' error when attempting to pass the data.
omg this is such a great tutorial!! i wasted 2 days trying to make my post/get methods work and was about to give up haha but fortunately i found this video! thank you for such a clear explanation!!!
I have also wasted 2 days. Hope this tutorial will give with i want.
For people in future check out
Flask CS50
The explanation is phenomenal
why are you subscribed to andyjaide?
Unbelievably helpful. Watched a few of these videos and I feel like I learned a ridiculous amount in just one day. Went from 0 knowledge of HTML and flask with basic python to feeling like I can make any website lol
Same. am all like isn't this too much.
Exactly what I needed for an example of how to use an HTML form with flask. I really appreciate how you provide a simple example and keep it to around 10 minutes. Thanks man, I'm trying to do my college homework for Python class and this was great.
I just watched this video 3 times to figure out that my post method wasnt working because I put "methods" in the html form attribute instead of "method".....i love coding so much
lol
Dude same 😭
🤣🤣
same :DD
Same mistake😢. Thanks
The clearest video on this topic I have seen so far. Thank you so much Tim. Really helpful and understandable for us absolute beginners.
This guy is a sick lad. Does't worry about or-complicated explanations and just gets straight to the point
Your videos are very user-friendly and easy to follow along with! You have helped me more than I could say! Thanks for all your hard work and dedication!
I really wanna move onto the next video but I had to stop and comment and say how great these videos are. This is EXACTLY what I've been looking for! Thank you SO much!
I'll be watching the videos in order, but hopefully you have a video the covers how to upload file to the server I can run functions on. If not maybe, you can make a video. It's something I've been stuck on for a while now. Thanks!!!
You saved me after 9 hours of coding your the best thank you thank you thank you
You don't know it but you're becoming my hero !
thanks! I was stuck all afternoon trying to connect a form and I solved it right away with your video.
much appreciate Tim! hope to see deep and advanced tutorials about Flask..
This video is great. I am a SQL developer, so python and HTML are a side gig for me. I was struggling with taking in input from a flask server and passing it to other functions but you have explained everything in a way that is both easy to understand and is translatable to my application's needs. Thanks so much!!!!
I am very glad that you have created these videos on this topic. this just saved me from failing a class.
Love how you give context to the content and what you're doing, great tutorial!
Very helpful video for figuring out how to use Get and Post requests with Flask. Thank you very much.
I did this because yes.
I put some pride into my work and merged the RENDER_TEMPLATE function with a dictionary called CONTENTS that is basically configuration.
Here is script Number 1
from flask import Flask, redirect, url_for, render_template
from settings import contents
def rendertemplate(name):
return render_template(name, contents=contents)
Here is script Number 2
contents = {
"forListTest":["This", "is", "a", "test."],
"title":"Trebla2"
}
Please note that this is super early on, so some of this is probably gonna change when i finish.
Brief and brilliant explanation.
Great material and finally I learnt to develop a web application!
This is really helpful. Thanks Tim, very clearly explained.
dude thanks so much, i wanted to know how to make buttons for my webpage and now it works thanks man
Thanks bro u r da best Tim. I really appreciate this because i have advanced alot
Hey, Tim. Would you mind showing us what packages have you installed on your Sublime Text?
Thank you so much, You saved my life. I hope your channel grow more & more
salamat dok sa inyo
salamat sa pagtulong niyo
pag-aalaga ay tapat at totoo
maayos na kalusugan
buong hangad kanino man
sa bawat pilipino'y kayo ang takbuhan
kaya't salamat dok
sa pagtulong na lubos
kalusugan namin naging maayos
salamat dok sa inyo
nakagabay lagi kayo
impormasyong hatid laan sa bawat tao
salamat dok sa inyo
salamat sa pagtulong niyo
pag-aalaga ay tapat at totoo
maayos na kalusugan
buong hangad kanino man
sa bawat pilipino'y kayo ang takbuhan
salamat dok (5x)
Best Instructor Ever !!
There goes my hero. Watch him as he goes!
this is exactly what I needed.
Please Tim IOT toturials plz .I trully really like and follow your Tutorials
This saves tons of time, thank you.
Thanks buddy. The videos were really helpful. To the point and informative as hell.
unbelievebly understandable, congrats!
Thank you so much, very helpful.
ty *Tim sorry for saying your name wrong last time.
I really appreciate these series.
The key difference between GET and POST - GET doesn't have request body. That's why POST is secure - you can send encrypted data .
Thank you, Really appreciate your work..!
this is an excellent series, thank you Tim
this is so good. great work! bless your day
Simple and Clear. Thanks a Lot
Very clear, thank you.
God bless you bro ❤
Thank you very much for this video! It was very educational for me :)
Great stuff, as usual! Thanks for sharing this! Any plans on discussing security, like input sanitization etc?
Tim, could you please make a Udemy course. I love your fantastic teaching style. Udemy makes it easier for us "third world" student to afford quality content.
Much appreciation from South Africa! ™️💯
I have a course on teachable!
@@TechWithTimsend the link broski
Cool, thx for this. I was working on a Flask app recently and this, I hope, will validate I did something good :) Waiting for more episodes.
Fantastic lesson, you helped me a lot. Thank you so much!
Waiting for next video impatiently ...
Thank you for this awesome tutorial!
Thanks a lot Tim
Appreciate your work keep it up!
best video tutorial
Thank you brother for this tutorial.
Amazing tutorial
absolute legend ty so much!!!
what a legend, very helpful
Thanks for your lessons!
so clear. thx , Tim.
Thanks for the great video Tim. Can you please explain how we can get more than one value in the login route if the form has more input tags?
have you found the solution to pass 2 values?
found a way to resolve this..
You have to parse the multiple parameters with the url (using javascript redirect option).. then when it has been redirected to your app route, then
var 1 = request.args.get('your_param_name1')
rvar 2 = equest.args.get('your_param_name2')
Hey Tim your video has been a great help to me but can you tell me how can I show the output on same page below my form when I click the button.
WARNING FOR BEGINNERS, MISTAKE AT THE BEGINNING OF THE VIDEO: a POST request is NOT more secure than a GET request.
The information being sent in a POST request is hidden from the URL, and that is all. Anyone wanting to intercept the data being sent across the network could easily do so.
While it is true that POST doesn't expose information via the URL, it exposes just as much information as a GET in the actual network communication between the client and server. If you need to pass information that is sensitive, your first line of defense would be to pass it using Secure HTTP.
Not trying to knock your video Tim, just wanted to make sure that new user's don't try to send passwords and other sensitive data across the network using only a POST request.
No worries! Thank you for pointing that out as a few others have as well. This was a critical mistake on my part as I did not define what I meant by secure. I will be the first to admit when I make a mistake and this was a big one! Thankfully we have people like you who can point them out
@@TechWithTim Hi Tim - maybe you should make a little text overlay on that part of the video to explain since many people might dig through the comments. BTW, your tutorials kick serious a$$
Thank you so much for the videos learning a lot...:)
lol @6:13
usefull and complete thank you
If youre having trouble with errors check task manager and see if there arw any python files running in background
HI, Instead of printing all the columns in GET request, How could I get only specific columns from the postgres table?
What is the purpose of "/" before the closing tags?
input is a self closeing tag
I heard that isn't necessary (HTML works with and without "/"). However, if u want to have page compatibile with XHTML, u need all closing (/) tags, even in sth like input, br and img
@@_b0mbix_ thanks
How would you go about adding posts/blogs?
Thanks for sharing
I dont get it why do you have also and base.html and index.html, can you show them and what is difference between this 2, great video, but I am confused with 3 html files insed of 2
guys! its important. When you copy Navbar, CSS and JS you have to use version Bootstrap v4.3. Now at 2020 October its v 4.5
new version makes lots of problem when you try Login with method POST
7:27 It seems you still get POST when you refresh it?
@@MuffinologyTrainer dude shut up and be grateful. You wanna pay $400 for a shitty udemy course? Go ahead. Nobody wants you to just complain and discredit the guy for his work.
If you watch closely, you'll notice that Tim was explaining things correctly. His mistake was due to an honest error. When re-posting, he merely went too fast and didn't change the URL. Be nice. I commend him and anyone who gives of themselves. No need for the rudeness and crass comments/language.
It seems the browser re-did the last action which was a POST. If Tim did tape enter in the url bar, he would have get a GET method.
Don't know if I'm clear, english is not my native linguage... :/
Hang, browsers repeat the last request they sent when they are asked to refresh a page. When the last request sent is a POST, when you refresh you get a POST again. A refresh would cause a duplicate form submission, which in almost all cases is not the desired action. For that reason, the browser asks for confirmation from the user (browser-pop-up message shown in the video).
Many users do not understand this warning from the browser. Consequently, it is considered good practice for web applications to never leave a POST request as the last request sent by the browser. This is achieved by responding to POST requests with a redirect instead of a normal response.
All these info comes from Miguel Grinberg's Flask Manual.
I think your question was pretty clever and you didn't mean to "complain" or "discredit" Tim, whom by the way rocks at teaching. Have a good day!
I think that it is a kind of bad practice using "/" URL. What if your username will be equal to "login"?
The better way is to use URL like "/user/" which will never collide with "/login" or any other pages we would have in the website root.
Great video. My doubt is that I need to send a value selected from a drop down as a GET parameter to my Flask backend. How do I do that? Here you used the function request.form[id] but I need to pass a variable (or parameter) which I would select from a dropdown list.
Hey Tim, Please continue that PYTHON to APK file Series ....Show us the method to convert KIVY project to APK
Yes PLEASE
Thanks Tim!
Does anyone else not know wtf Tim was doing from 4:28 to 5:08?
Dear bro
Tnx for your video .
I need to know how i can appear the captcha code in busy or overloaded sites when tis not shown captcha code ( just show the image box instead off captcha code) by get and post method.
Hi! Awesome!
What would you recommend for hosting of the simple site writing in python?
Interestingly, I have left the re-route function from the previous video in the code and the POST, GET function re-route uses that one instead of the one I have created for it. Wonder why?
This gives me error as "The method is not allowed for the requested URL." even if i wrote exactly the same code.
My file directory is Flask_tutorials/tutotrial.py templates/login.html base. Html index. Html but I still keep getting jinja2 exceptions
me too
import request at top
Thanks It worked
Thanks for the video Tim. Can you recommend a book about web development?
If you are getting the error 405 Method not allowed use the line methods = ["GET","POST"] on the @app.route wrapper seperated by a comma next to the subpage
like so app.route("/login",methods=["GET","POST"])
fixed the problem for me
Good video! I thinking how to get that data from input and just print it in console (other purpose, than generating page - for example just adding something to db), I tried but without success. Maybe is super-easy and I am just to tired ..
Hey Tim can you make a tutorial for how to conect html,css,js with FLAK, and we should also be able to send and receive data in the json format, and I hope you use axios, or else you can use jquery and ajax.
Ok, wow, after a lot of struggle I was able to make this work. Phew! But I was actually trying something way more advanced, to obtain the inputs from drop down lists and print them on the screen. Tim, is it possible to print the value in the same main page? Right now in order to display the values I am needing to go to a new Url, which doesn't make sense. I want to display the values in the same page as the drop down menus (there are various of them).
If we on vsc will we choose pyton Or html for working?
7:09, after I login it comes with this error:werkzeug.routing.BuildError: Could not build url for endpoint 'harshi' with values ['usr']. Did you mean 'static' instead?
plz help thanks
try doing the tutorial again, it's great as its only a 10-minute video, I don't know if over the past week you've resolved that problem but I'm 9 minutes in and I have no problems
@@safwanakhtar2528 Yes thank you I resolved it, it was a silly mistake
@@minecraft4life688 bro what was the mistake I am getting same problem
@@tradingwithsujay for the redirect I put redirect to the user page but I put just put user, you have to put user in quotation marks because that's the page
Atleast that was the mistake for me
Can I have the server st a different domain than the front end ? How would i communicate? Via js request
07:34 Determine POST and GET in login function
Thanks.
Thanks
If we need to transmit large data through a redirect, how can we do that? I encountered an 'ERR_RESPONSE_HEADERS_TOO_BIG' error when attempting to pass the data.
Awesome !!!
MAN U HELPED ME SO FKING MUCH THXXX
Hi Sir, pls make a video on Flask with Microsoft SQL Server Connection, Get Data and Display on web , Show MSSQL TABLE DATA AS GRIDVIEW ON WEBPAGE
Is this tutorial or a skill show?
For my 405 issue I had to change the html code to
Thanks bro!!
I would like to ask to you if there is a chance that you will show up how to cooperate with sqlite and flask together. Thanks for watching this.