Тёмный

Flask Tutorial #2 - HTML Templates 

Tech With Tim
Подписаться 1,5 млн
Просмотров 442 тыс.
50% 1

In this flask tutorial I will show you how to render and create HTML templates. I will also discuss how to dynamically create HTML with the use of python code in your html files.
Text-Based Tutorial: techwithtim.net/tutorials/fla...
Playlist: • Flask Tutorial #1 - Ho...
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.teachable.com/p...
📸 Instagram: / tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-rusci. .
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
💵 One-Time Donations: www.paypal.com/donate/?token=...
💰 Patreon: / techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
- Tech With Tim
- Python Tutorials
- Flask Tutorial
- Flask Python HTML Templates
- Flask Python HTML
- Templates Flask
#Python #FlaskPython #Flask

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

 

8 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 303   
@nelimalu601
@nelimalu601 4 года назад
I literally just finished tutorial #1 and was looking to see if #2 was out, and it says "6 minutes ago" I'm so happy
@smartconjurers2509
@smartconjurers2509 4 года назад
Well it's saying 6 months ago now😁😁
@bayramalibostanc9812
@bayramalibostanc9812 4 года назад
@@smartconjurers2509 Hello form 2020!
@lucky0ne620
@lucky0ne620 3 года назад
Now it’s saying 11 months ago 🤣🤣🤣
@n9dev837
@n9dev837 3 года назад
@@lucky0ne620 hey ure here lol can I ask u a question
@n9dev837
@n9dev837 3 года назад
@Kevo hi I’m still in 2020. How’s life?
@SkyFly19853
@SkyFly19853 4 года назад
And HTML becomes more useful because of Python... 💯💯💯💯
@urjitchakraborty5813
@urjitchakraborty5813 3 года назад
always ahs been
@SkyFly19853
@SkyFly19853 3 года назад
@@urjitchakraborty5813 Well, it depends...
@hudakhan5973
@hudakhan5973 3 года назад
Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. getting this error again and again
@elarvis
@elarvis Год назад
so for anyone having issues with this line: return redirect(url_for("user", name="admin")) it took me like 2 hours to understand the problem and here it is: the function / takes the argument name and makes it into a url that will say "Hello name"... if you put "admin" as the argument the url will basically just redirect to the same url tyhat is defined before ("/admin") and cause it to loop and redirect it to admin again. The toturial didn't specifically mention this but I believe its very important :D THANKS!
@garfield-pro
@garfield-pro Месяц назад
Thanks. What's the solution for this? Is the redirection logic wrong or the URL definition of / which also encompasses /admin is wrong?
@notarvis
@notarvis Месяц назад
@@garfield-proYeah, just rename the function ( I think... this was a while ago so my memory is hazy )
@kellzbaker
@kellzbaker 29 дней назад
search up decorators my good fellow ,corey Schafer will sort you out
@k0n3j0
@k0n3j0 3 года назад
I was able to make a web app for a work project I was working on because of this video. Thank you.
@balloney2175
@balloney2175 3 месяца назад
Good for you!
@khang-jm4pm
@khang-jm4pm 3 года назад
Thank you Tim for the tutorial, I very appreciate your hard work to produce quality videos like this for us to learn
@mohiitsihag
@mohiitsihag 8 месяцев назад
hey tim, thanks for explaining this in such an easy way , "l will give you few more examples so that you guys really understand it " takes my heart
@persephassa217
@persephassa217 4 года назад
Extremely useful!! You're the best! It was easy to understand yet powerful. I simply can't wait to see the other videos.
@odinsrensen7460
@odinsrensen7460 Год назад
Thank you so much. Everything you're saying makes so much more sense and is so much more informative than the other tutorials I've found.
@shehab976
@shehab976 2 года назад
Ok,someone make me understand the basics of flask at last...what a series❤️
@KeithFlint350
@KeithFlint350 2 года назад
I so much appreciate when we can deal with errors in tutorials! :)
@magorzatag7157
@magorzatag7157 4 года назад
Finally understand. Best tutorial I've ever seen. thank you.
@mrjax2760
@mrjax2760 4 года назад
keep up bro and make a full responsive website please like this comment guys !!!
@LesterFD
@LesterFD 2 года назад
Man you're just really the best python teaching youtuber I know
@PeranMe
@PeranMe 4 года назад
Great stuff! Looking forward to more parts!
@alerey4363
@alerey4363 Год назад
This part I understood better than the first; coming from php it's easy for me to see the "inline" dynamic language content mixed with the static html code.Thank you Tim.
@imveryhungry112
@imveryhungry112 Год назад
Crazy how powerful flask is, thanks man
@jacksonwalker3445
@jacksonwalker3445 4 года назад
Thank you so much. I have been struggling to make progress with this and you made it SO easy to understand :-D
@javieraquezada5836
@javieraquezada5836 3 года назад
THE BEST! just found this tutorials you are amazing!!
@isakpallas2546
@isakpallas2546 4 года назад
Yay! I love these tutorials!
@derenece1708
@derenece1708 5 месяцев назад
Thank you for teaching me so clearly and quickly something I couldn't learn at school.
@soufianefariss
@soufianefariss 4 года назад
Keep the good work Tim. Love it!
@ignskeletons
@ignskeletons 2 года назад
I am learning more from your RU-vid tutorial than I did a year in community college
@muhammadradwan4730
@muhammadradwan4730 Год назад
For anyone thinking how to pass context to HTML template as a python dictionary, you can do the following: # In python context = { "name": name, "age": 27 } # The same if you do: render_template('index.html', name=name, age=27) return render_template('index.html', **context) **variable is a python syntax to populate the key value pairs to key=value like the idea of **kwargs when you want to pass arbitrary number of arguments to methods.
@HypnosisBear
@HypnosisBear 9 месяцев назад
Thanks! I was wondering the same.
@angel-dine
@angel-dine Год назад
If your render_template is not working, maybe giving you template not found error, make sure the folder which has your index.html file is named "templates" and not "template". Hope this helps.
@nila4452
@nila4452 9 месяцев назад
Such a life saver comment. Thank you so much.
@devkarnik5528
@devkarnik5528 8 месяцев назад
Thank you So Much!
@redchxrlie
@redchxrlie 2 года назад
You saved our entire project!
@alexharris6134
@alexharris6134 4 года назад
I love this series thank you so much
@HostDotPromo
@HostDotPromo 4 года назад
Flask is awesome, great break down and big congrats on 💯k
@TechWithTim
@TechWithTim 4 года назад
Appreciate it 👍
@daniyaldehleh8253
@daniyaldehleh8253 3 года назад
Best video on youtube! Thanks man!!
@andregomes2629
@andregomes2629 3 года назад
Thank you Tim! Nice and simple 🎯
@droid8770
@droid8770 4 года назад
awesome tutorial bro i was looking for a simple and friendly tutorial and here it was Thanks
@aayushneupane4098
@aayushneupane4098 4 года назад
Thanks man you really saved my time! really liked your video
@ProgrammingwithPeter
@ProgrammingwithPeter 4 года назад
Just found your channel and it's great!
@tymothylim6550
@tymothylim6550 3 года назад
Thank you very much for this video :) It was very clear and helpful for me!
@vijayvinayak
@vijayvinayak 4 года назад
Really nice understanding... Thank you sooo much❤️
@zedrobot5864
@zedrobot5864 4 года назад
Thank u for this course and u almost hit 100k bro
@JonNordland
@JonNordland 4 года назад
I love your approach!
@rayganmudberry375
@rayganmudberry375 4 года назад
Awesome work tim. thank you.
@krystianmasiak6212
@krystianmasiak6212 Год назад
Tim made so many proofs that I'm 100% sure that he hasn't made this up. :) Awesome video! :)
@tinos8640
@tinos8640 4 года назад
This guy is a great teacher
@MmM-iu1sz
@MmM-iu1sz 3 года назад
Great video saw this channel now and like the content which is very precise and understandable.
@zacgreene8283
@zacgreene8283 4 года назад
First, also I love your videos, they tough me how to code python and pygame and now I’m working on a flappy bird duplicate.
@meqdaddev3100
@meqdaddev3100 4 года назад
I'm coming from Django background, it is very easy for me, and very similar toooooo Thanks Tim
@mouadtaoussi42
@mouadtaoussi42 4 года назад
Your Work Apperciated Honestly ! Thank You!
@k0n3j0
@k0n3j0 3 года назад
Thank you for the video series!!!!
@danielmb3678
@danielmb3678 4 года назад
great stuff, thanks a lot for this!
@abrahamceviz
@abrahamceviz 4 года назад
We love you my friend. Good job.
@funworldtamil7394
@funworldtamil7394 3 года назад
Oh man! You're ma life saver... I can get what I really need to do for ma web page... Tons of love!
@CSSHANUSG
@CSSHANUSG Год назад
thank u manh! clearly explained
@sauravsikdar4841
@sauravsikdar4841 4 года назад
Man you and your course is awesome!!!!!!!!!!!!!!!!!!!!! :)
@deep2peak108
@deep2peak108 2 года назад
its really helpful bro god bless you
@abhishekvobbareddy4342
@abhishekvobbareddy4342 Год назад
Hey Thanks a lot for the video, this helped me in deploying my ML model, Thank you
@peace01787
@peace01787 2 года назад
Very very thanks bro. I was suffering from the .html file should be in template folder directory next to the python file for two days. It was quite frustrating . Thank you.
@houda9434
@houda9434 4 года назад
what an awesome channel! Keep it up 😀
@neiladriangomez
@neiladriangomez 4 года назад
He is Timmy Turner while Joe and Bill are his fairies. Thanks for the tutorial Tim🤟🏻
@paulborstorf9538
@paulborstorf9538 3 года назад
Wow amazing tutorial!
4 года назад
Well done. Thanks!
@buddybob5502
@buddybob5502 4 года назад
Hey tim, a great way to stop righting the start of an html file is saying
@user-ns8ur8yh8r
@user-ns8ur8yh8r 3 года назад
thanks a lot of...you can explain so good and perfect........thanks a lot of Sir
@lucifel1004
@lucifel1004 2 года назад
very clear! thanks!
@ImJhon-jr5tn
@ImJhon-jr5tn 3 года назад
You are really legend bro!...
@bartosznowak5625
@bartosznowak5625 Год назад
thanks for the lessons
@aidangasim
@aidangasim 3 года назад
U ARE ROCK!!!!just couz of tiny detail my template wasnt opening,noone mentioned it u entioned that folders name templates is compulsory...ure amazing thanks
@GeorgeBentes
@GeorgeBentes 2 года назад
So far, so good
@ViratKohli-jj3wj
@ViratKohli-jj3wj 4 года назад
Congratulations for 100k subscribers👍👍👍
@TechWithTim
@TechWithTim 4 года назад
Thank you dude
@eshaangupta4101
@eshaangupta4101 3 года назад
Amazing content!
@jesusdacoast872
@jesusdacoast872 4 года назад
Great tutorial :)
@siddhanthmetla9638
@siddhanthmetla9638 4 года назад
For those who're getting a plain white screen in browser while running the render_template with index.html, just save the index.html,then run it.
@igrewupinkaermorhen9459
@igrewupinkaermorhen9459 3 года назад
what do you mean by saving it then run it?
@YnjeviYhhei
@YnjeviYhhei 2 года назад
thank u brother
@wiljamihakkarainen4258
@wiljamihakkarainen4258 Год назад
Actual chad lifesaver comment
@connormarler
@connormarler Год назад
Dang, this is happening to me. I resaved my index.html and it is still a blank white screen. Is that what you meant?
@chtholly1625
@chtholly1625 11 месяцев назад
thx you, i spend over 2hour reseach but can not fix error white screen
@priyalhedau634
@priyalhedau634 3 года назад
In case someone is getting 404 or any error ,check in each python expression u have written %} or {% not % } or { %. Spaces giving error
@Dallouya
@Dallouya 2 года назад
Thank you!
@Edgaro
@Edgaro 3 года назад
I love this guy!
@kristypolymath1359
@kristypolymath1359 4 года назад
The python code you write from within the html page appears to be very, very limited. When I removed the {% endfor %}, thinking that I should not need to "end" a for loop in python, i was presented with errors saying that "endfor" was needed.
@josefranciscoramirezrodrig1726
@josefranciscoramirezrodrig1726 4 года назад
Hey Tim! I love your tutorials, I have a question. Can you make something about embedding matplotlib graphs and numpy arrays for doing some educational stuff in a chemical engineering website? Thanks in advance. Francisco
@ZeRONazgul
@ZeRONazgul 2 года назад
The best!
@fcmorena246
@fcmorena246 3 года назад
this guy amazing
@marcin_lewandowski
@marcin_lewandowski 6 месяцев назад
Thanks Tim
@harshith_takkala
@harshith_takkala 3 года назад
Awesome !!!
@WaldirBorbaJunior
@WaldirBorbaJunior 4 года назад
Wow amazing
@Jukera
@Jukera 4 года назад
Nice tutorial, can you cover button pressing in future videos?
@tolgaaydin6430
@tolgaaydin6430 3 года назад
Thanks 💯
@mageshj6931
@mageshj6931 3 года назад
1:15 so to prove to you I'm not making this up! Lol.😂👍
@nonghieu825
@nonghieu825 4 года назад
Are u familiar with React JS ? If yes please make a series about it, ur so good at teaching bro.
@Gustavostarke
@Gustavostarke 2 года назад
Thanks mate
@fvgoya
@fvgoya 4 года назад
Great content. I will use this knowledge with Micro controllers like Arduino or even the Raspberry Pi GPIO. Just one question: Is there a way to, when we make some changes and save the file, automatically restart the server? Something like nodemon for Node.js. Thanks !!!
@Overconsulting
@Overconsulting 4 года назад
Great Job Man ! I just think you can add your navbar in a different file for example nav.html et include it. (I search for include... That's why I said that ^^)
@simarpreetsingh6604
@simarpreetsingh6604 2 года назад
Hello, I'm hosting my html pages on webflow. So can I call those html pages from this python backend? I don't want to create html files here separately. Thanks
@jayasingh7810
@jayasingh7810 4 года назад
Thanks alot 🙏
@Rubded
@Rubded 2 года назад
Thank you. Not exactly what I needed, but you helped a lot.
@DD-mr2tk
@DD-mr2tk 9 месяцев назад
Awesome
@EUU100
@EUU100 3 года назад
Thanks for the video. If i just want to make a portfolio website would this be the best thing to use? It seems a better idea than django since i think i will just need one page and i am still a Python newbie
@krisko5186
@krisko5186 3 года назад
thanks for this very helpful I 'm struggling to render images in jinja
@akankshashanbhag7264
@akankshashanbhag7264 3 года назад
thanks!!
@Francisco-me2eu
@Francisco-me2eu 3 года назад
Thank you
@gavinpayne4882
@gavinpayne4882 Год назад
would {% %} still work if you were doing it from a separate js file linked to the .html?
@gurambregadze5959
@gurambregadze5959 2 года назад
Hi Tim. First of all, thanks for the useful video. I have a problem though. It looks like all the code in the curly braces have not been implemented with me. I only see ''Home page!'' text whatever I do. My Python version is 3.9.5. Could it be the cause?
@mordfustang1933
@mordfustang1933 3 года назад
Wow such a simple tutorial and i cant even make the program work.
@yvzozy
@yvzozy 3 года назад
Whatever I do I always get blank page when using render_template. I used visualcode and pycharm the result is always the same what can be the problem
@josephlang2586
@josephlang2586 2 года назад
This is great. how would I also impliment css. bar inline styling
@Herzfeld10
@Herzfeld10 4 года назад
if anyone encounter a problem with the console where it's been crashed but the port is still used and you cannot execute the script afterward, just type in this in the apple cmd to kill the process on the :5000 port : kill -9 $(lsof -t -i:5000) I put it in a comment right under the "run" part of the script : #To kill the process, terminal : kill -9 $(lsof -t -i:5000) So i never forget how to do it if there is a crash and the port is still somehow occupied by python.
@MrKelbessa
@MrKelbessa 4 года назад
“Jinja” is the name of the template engine you use in your html file.
@thomasnicholson2989
@thomasnicholson2989 4 года назад
me too );
@thomasnicholson2989
@thomasnicholson2989 4 года назад
mr kelbessa I just fixed it you should put your html file in a folder you can call it templates and it worked with me so i think it’s the solution good luck
@obi666
@obi666 4 года назад
@@thomasnicholson2989 Thank you! I had te same problem.
@andrewzolensky9807
@andrewzolensky9807 11 месяцев назад
Hi Tim, thank you for the tutorial. The code for redirecting the admin page is not working for me. Is this code posted anywhere so i can download and try it?
Далее
An Introduction to Software Design - With Python
34:05
Просмотров 512 тыс.
Templates & HTML Files - Flask Tutorial Series #3
23:00
Learn CSS flexbox in 10 minutes! 💪
10:01
Просмотров 110 тыс.
The TRUTH About Computer Science Degrees in 2024
17:25
Python JSON Mastery: From Strings to Services
13:36
Просмотров 1 тыс.
Flask Blueprints Make Your Apps Modular & Professional
13:33
Create A Python API in 12 Minutes
12:05
Просмотров 552 тыс.