Web Development with Python Tutorial - Flask & Dynamic Database-Driven Web Apps

  Рет қаралды 312,468

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Learn how to develop Dynamic Database-Driven Web Apps with Python, Flask, and MySQL. This course is broken up into two parts. In part one, you will learn how to build and deploy a site using the Flask Python web framework. In part two, you will connect the Flask application from the first part to a cloud MySQL database and learn how to deploy a production-ready database-driven web application.
✏️ Aakash N S created this course.
🔗 Submit your project & earn a certificate: jovian.com/learn/web-developm...
🔗 Check out Jovian’s KZbin channel: / @jovianhq
Notes & references links:
🔗 Part 1: jovian.com/aakashns/web-devel...
🔗 Part 2: jovian.com/aakashns/database-...
⭐️ Contents ⭐️
Part 1
⌨️ (0:00:00) Introduction
⌨️ (0:02:07) 1.1 Project Setup & Flask Basics
⌨️ (0:22:25) 1.2 Building Web Pages using HTML
⌨️ (0:40:57) 1.3 Styling with CSS & Bootstrap
⌨️ (1:08:25) 1.4 Dynamic Data using Templates
⌨️ (1:27:22) 1.5 Deploying to the Cloud with Render
⌨️ (1:42:39) 1.6 Functional and Aesthetic Improvements
⌨️ (1:58:44) 1.7 Summary & Future Work
Part 2
⌨️ (2:04:19) Database-Driven Web Applications
⌨️ (2:07:24) 2.1 Project Setup & Deployment
⌨️ (2:21:44) 2.2 Cloud MySQL Database Setup
⌨️ (2:36:20) 2.3 DB Connection with SQLAlchemy
⌨️ (2:56:22) 2.4 Display DB Data on Web Page
⌨️ (3:20:04) 2.5 Dynamic Database-Driven Pages
⌨️ (3:49:23) 2.6 HTML Form for Applications
⌨️ (4:15:37) 2.7 Saving Applications to DB
⌨️ (4:26:23) 2.8 Summary & Future Work
⌨️ (4:37:50) Conclusion
🎉 Thanks to our Champion and Sponsor supporters:
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Erdeniz Unvan
👾 Justin Hual
👾 Agustín Kussrow
👾 Otis Morgan
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Пікірлер: 360
@jovianhq
@jovianhq Жыл бұрын
We hope you enjoy this tutorial, and we look forward to seeing what you'll build! If you'd like to get your project reviewed by our team & earn a certificate, register here for free: jovian.com/learn/web-development-with-python-and-flask If you have any questions or face issues, please post them in the comments and we'll help you out. Do check out our KZbin channel as well, where we're posting new tutorials every week. Thanks @freecodecamp and Beau for hosting us! 🙏🏼
@officialmoai3107
@officialmoai3107 Жыл бұрын
Thanks!
@bosserichie5578
@bosserichie5578 Жыл бұрын
I am stuck at the function "def load_jobs_from_db()". I keep getting "TypeError: cannot convert dictionary update sequence element #0 to a sequence"... Little help here please...
@mariadelendik7722
@mariadelendik7722 Жыл бұрын
@@bosserichie5578 Good day everyone. I want to express my deep gratitude to the author of the course for the work done. Thank you, your course is very informative. I'm having some problems in the code at 4:20. I understand that this is due to the fact that the version of the SQLAlchemy is 2.0.4. Solved it like this: def add_application_to_db(job_id, data): a=data["full_name"][0] b=data['email'][0] c=data["linkedin_url"][0] d=data['education'][0] e=data['work_experience'][0] f=data['resume_url'][0] with engine.connect() as conn: conn.execute(text(f"INSERT INTO applications (job_id, full_name, email, linkedin_url, education, work_experience, resume_url) VALUES ({job_id}, '{a}','{b}','{c}', '{d}', '{e}', '{f}')")) At the same time, in the "app.py" file, you need to change the dictionary to: "data = request.form.to_dict (flat = False)" because Flask returns a dictionary of the "ImmutableMultiDict" type, and we need a simple dictionary() All success in your studies!
@jovianhq
@jovianhq Жыл бұрын
@@bosserichie5578 Try asking this question on the course discussions page, our team will reply: jovian.com/learn/web-development-with-python-and-flask/discussions
@paulcal3500
@paulcal3500 Жыл бұрын
​@@jovianhq Hi, I am new to using replit. I followed exactly what you did but am getting this error: "sh: line 1: python: command not found exit status 127" Any idea how to fix this?
@robertokoba7
@robertokoba7 Жыл бұрын
By and through you I have been able for the first time in my life deploy a website. I am going to watch this tutorial time and again until I become competent. Thank you sir. Receive my humble respect.
@jovianhq
@jovianhq Жыл бұрын
We're delighted to hear this, keep building! Do come check out other courses & tutorials on website jovian.com/learn
@parrobo
@parrobo 5 ай бұрын
You are a super teacher. I wish we could teach students in the University in such granularity and functionality. There is no point dumping boring theories onto students' brain about www, HTTP, etc. Tutorials like this puts everything into context. Well done and thank you so much for making and sharing these contents.
@nambativepeter8514
@nambativepeter8514 2 ай бұрын
Aakash has been a very big blessing to my career. I had an interview and somehow passing Algorithms through code challenges was difficult. But the moment i lay hold of Aakash tutorial on Data structures and algorithms. After going through the course this time i went into the test and came out successful. Thank you Co-founder of Jovian Aakash
@SreevathsaBV
@SreevathsaBV Жыл бұрын
This is gold! The flow was absolutely flawless and understood without having to rewind and watch. Great stuff! 👌
@jovianhq
@jovianhq Жыл бұрын
Thanks, we're glad you liked it!
@Pier_Py
@Pier_Py Жыл бұрын
sir, you are the best. Just started with web development and i literally understood everything without any problem. thank you very much
@Matty100
@Matty100 8 ай бұрын
Thank you Aakash and freeCodeCamp for taking the time to create and share this video it was a great walk through for flask and mysql in the cloud!!
@johngodoy2929
@johngodoy2929 Жыл бұрын
First, I'd like to say this is one of the most fluid and well explained coruses i've ever taken
@jovianhq
@jovianhq Жыл бұрын
Thanks, we're glad you enjoyed the course!
@banabasejiofor7470
@banabasejiofor7470 Жыл бұрын
For those experiencing some issues around 3:29, this worked for me def load_job_from_db(id): with engine.connect() as conn: result = conn.execute( text(f"SELECT * FROM jobs WHERE id={id}") ) rows = [] for row in result.all(): rows.append(row._mapping) if len(rows) == 0: return None else: return row
@haniyrasul6710
@haniyrasul6710 4 ай бұрын
Thanks for the code! For my case, I had to modify the last part. You saved the day. Cheers! rows = result.all() if len(rows) == 0: return None else: return dict(rows[0]._asdict())
@de-frag0121
@de-frag0121 Жыл бұрын
This was absolutely amazing, built a fully packaged website with dynamic data and email linked, basically everything
@jovianhq
@jovianhq Жыл бұрын
Thanks! There's definitely a lot more to web development that we haven't covered here, but we wanted to demonstrate that the end-to-end process of a fully functional website isn't as long or hard as it seems. 🙂
@de-frag0121
@de-frag0121 Жыл бұрын
@Jovian Absolutely, but for a starter guide this covered tons of features. I was able to build a well packaged web just by following your tutorial. Thanks again and keep up the great work 👍
@rizvy99
@rizvy99 9 ай бұрын
@@jovianhq law, cantonment, religious theology, business naming, economy, history, literature, surrounding flora and fauna is related to all Jews mastermind game, why we need to disguise or mockery that we are different. the thing is everyone is on the same page
@princekhunt13579
@princekhunt13579 6 ай бұрын
This is a very good tutorial. You will learn flask, how to deploy on render and hosting.
@mariumbegum7325
@mariumbegum7325 Жыл бұрын
The fact that this is available is fantastic!
@teogf
@teogf 10 ай бұрын
One of the best tutorial I've ever seen about Flask.
@tabannikdel6475
@tabannikdel6475 3 ай бұрын
Simply great! Thank you for this great step by step project. I can see my project built up by only watching your video. Many many thanks.
@franciscofurey4878
@franciscofurey4878 9 ай бұрын
After many hours i finally finish this course! REally nice to get some practice. Thanks!!! a lot.
@penujahansith2688
@penujahansith2688 Ай бұрын
The course is really cool. the best tutorial for flask for beginners
@KhelGyanOfficial
@KhelGyanOfficial 11 ай бұрын
This tutorial is just awesome!! Bro please make one similar video which will include HTML,CSS, Java Script, Angular & Database in that. Mainly I would like to understand how javascript Anular and DB work together.
@SatyaMedidi
@SatyaMedidi 11 ай бұрын
This is Awesome. Please continue with the next steps!! This Content is GOLD!!
@jamesosewe7296
@jamesosewe7296 Жыл бұрын
Wow ! Wow ! Wow ! Wow !!! This is just absolutely fantastic. This is a whole career
@rajuljha
@rajuljha 6 ай бұрын
By far the best tutorial I have seen, explaining the end to end workflow and resolving errors on the go. Thank you so much FreeCodeCamp and Aakash!!
@prajwalm.s7976
@prajwalm.s7976 5 ай бұрын
were you able to create a free database using Planet scale?
@ajaykuchhadiya5812
@ajaykuchhadiya5812 11 ай бұрын
I usually don't comment on videos but this one is super helpful. cheers to you man , This was flawless
@sambitjasu940
@sambitjasu940 Жыл бұрын
Absolutely love this course.. Thank you 🙂
@jovianhq
@jovianhq Жыл бұрын
Thanks, we're glad you found it useful!
@mohamadderouich1899
@mohamadderouich1899 5 ай бұрын
Thank you very much for this tutorial, it helps me a lot to understand how web dev works and to build a good mindset about internet and web dev. thank you very much
@arepitas5019
@arepitas5019 Жыл бұрын
Thank you for this, so well-explained and comprehensive!
@jovianhq
@jovianhq Жыл бұрын
You're welcome! 🙂
@akashkunwar
@akashkunwar 2 ай бұрын
RReally thank you it has been a great help. I was trying to learn flask form other sources but this was the most helpful 4.5 hr video.
@yogeshmishra6025
@yogeshmishra6025 Жыл бұрын
Thank you very much for this tutorial, i could understand entire tutorial, and make it work on my laptop, render and planetscale, I used PyCharm on my laptop instead of replit, and the insert functionality I had to make some changes to make it work - had to use key value pair : values={'job_id': job_id, 'full_name':data['full_name'], 'email':data['email'], 'linked_url':data['linkedin_url'], 'education':data['education'], 'work_experience':data['work_experience'], 'resume_url':data['resume_url'] } and then add this 'values' to the conn.execute (query, values)
@sandeepsudhakar8803
@sandeepsudhakar8803 8 ай бұрын
Very good tutorial and should help many developers to build on similar lines. Great job 👍
@bombasticnonsense4247
@bombasticnonsense4247 Жыл бұрын
I am grateful to see a tutorial that is not using SQLIte. Looking forward to this. Thank you.
@jovianhq
@jovianhq Жыл бұрын
Yeah, we're using PlanetScale to set up a free MySQL database here. You can also use Supabase or Neon if you'd like to use Postgres.
@akj3344
@akj3344 Жыл бұрын
@@jovianhq Gonna finally try neon. Lets see
@fleckenfurz77
@fleckenfurz77 7 ай бұрын
@@jovianhq Is there another way except giving PlanetScale credit card information?
@macchiato1083
@macchiato1083 8 ай бұрын
In case you are having a problem with the images not being displayed in the /job/id after including the banner.html and nav.html into your jobpage.html around 3:36:33, you will need to go into the banner.html file, in the add ../ to your image source path so it will be like this src="../static/hero.jpeg" and remember to apply the same to nav.html file too. That should fix it. Good luck!
@adambishop2997
@adambishop2997 7 ай бұрын
This is actually so helpful, Thank you so much!
@lksdf4380
@lksdf4380 Жыл бұрын
Thank you bro! It's so cool course for Flask beginner.
@RadomName3457
@RadomName3457 Жыл бұрын
Very useful tutorial, thanks a lot, Jovian and Freecodecamp!
@huytrant
@huytrant Жыл бұрын
Web Development with Python Tutorial very helpful video, i learned a lot from here. Looking forward to the next videos
@jovianhq
@jovianhq Жыл бұрын
Glad you liked it!
@brainstormingsharing1309
@brainstormingsharing1309 Жыл бұрын
Always keep it up! You're doing great! 👍👍👍👍👍
@jovianhq
@jovianhq Жыл бұрын
Thanks, we're glad you enjoyed the tutorial!
@jacktoneclarance5792
@jacktoneclarance5792 9 ай бұрын
If you're stuck at 2:56:09 this worked fine for me: with engine.connect() as conn: result = conn.execute(text("select * from jobs")) result_dicts = [] for row in result.all(): result_dicts.append(dict(row._mapping)) print(result_dicts)
@proytookhdutta32
@proytookhdutta32 9 ай бұрын
Dhanyawad Mitra!
@Bic-Jin
@Bic-Jin 5 ай бұрын
👍👍
@juwonlosiyanbade6320
@juwonlosiyanbade6320 4 ай бұрын
You're my hero! Let's just say I should have checked the comments 2 hours ago
@joelfernandez5141
@joelfernandez5141 Ай бұрын
Thank you bro
@swastiksharma7637
@swastiksharma7637 9 ай бұрын
For those facing issue related to the TypeError while appending the row in the result_dict at 2:56:00 can use result_dicts.append(row._mapping), i was also facing this issue wasted around 2 Hrs to figure it out!
@macchiato1083
@macchiato1083 8 ай бұрын
You made my day! I was looking to why I was having this error and I looked online but I could not get around it. Thanks a bunch!
@kimdiane4680
@kimdiane4680 7 ай бұрын
wow thank you so much!!!! You help me a lot ;)
@Bic-Jin
@Bic-Jin 5 ай бұрын
👍👍👍
@DilshadHussainDH
@DilshadHussainDH 5 ай бұрын
bhai bhai bhai!!!! :) Thank You!!
@aryanthombre2971
@aryanthombre2971 2 ай бұрын
thanks a lot man that really helped
@LifeCodeGame
@LifeCodeGame Жыл бұрын
Take the first step towards becoming a web developer with Python by learning Flask and Dynamic Database-Driven Web Apps with this comprehensive course!
@user-ed6kq1mv4m
@user-ed6kq1mv4m 27 күн бұрын
hi all, Facing issueat 3:30:04,during template rendering the title is not dynamically passed in to my html kidnly provide any work around if anybody faced issue here thankyou
@pukhrajkumawat7570
@pukhrajkumawat7570 8 ай бұрын
If you don't get proper dictionary @3:26:50 here is the function that worked for me: def load_job_from_db(id): with engine.connect() as conn: result = conn.execute(text("SELECT * FROM jobs WHERE id = :val"),{'val': id}) row = result.fetchone() return row._asdict()
@yashumaria
@yashumaria 8 ай бұрын
Thanks :)
@minhajmasood5706
@minhajmasood5706 4 ай бұрын
Hey thanks for the solution however, a small edit to your snippet did the magic for me: def load_work_from_db(id): with engine.connect() as conn: result = conn.execute(text("SELECT * FROM work WHERE id = :val"),{'val': id}) row = result.fetchone() if row: return row._asdict() else: return None Thing that is a bit confusing to me is why on earth the original code doesn't work. I mean it seems to be working when the Prof is writing it but when I followed his methods it won't work for me. Anyhow Thanks for sharing your solution!
@chakibheraoua8125
@chakibheraoua8125 3 ай бұрын
Great job ! Thank you for this tutorial
@jerryk.7582
@jerryk.7582 Ай бұрын
i wanted to share the web site i developed using this video cos its my frst time web though i used pycharm cos my code on replit was like #python not found so i knew there aint way after trying many time,i watched this video for two weeks while building my own and learnt everything, aakash is my teacher for life
@PodShorts1512
@PodShorts1512 Ай бұрын
planetscale have no free plan now....how you access this for free?
@orionNsirius
@orionNsirius Ай бұрын
@@PodShorts1512 I just checked PlanetScale, it still offer free plan as Hobby.
@lukaszbolach506
@lukaszbolach506 6 ай бұрын
Hello community! I stucked around 3:18. Does anyone know why after deploying to Render, and building whole app correctly I got error: access denied for user : ..userHameHere... and right after that notification on email from planet scale that 'leaked secret has been revoked' ... database password has been detected in public repository onGH. Any connections using this password will be disconnected. Any ideas how to fix it?
@aryanthombre2971
@aryanthombre2971 2 ай бұрын
Loved your content , is it important to buy a domain to put it on your submit project and earn certificate section?
@Su_Code
@Su_Code 6 ай бұрын
this guy is a god level teacher
@greedycode
@greedycode 8 ай бұрын
when 3rd part of this video is coming? Great work man👍👍
@fifamontage30
@fifamontage30 5 ай бұрын
This is Gold bro 👌
@memusirobi5031
@memusirobi5031 10 ай бұрын
wow am grateful for the great work done here💖😄
@earlymorningcodes6100
@earlymorningcodes6100 9 ай бұрын
one of the best lectures.Akash can you just help me how I can learn/master jinja template
@TECHWITHSEBASTIAN
@TECHWITHSEBASTIAN Жыл бұрын
This was like super useful ! Thank you a lot Sir , I appreciate your work
@jovianhq
@jovianhq Жыл бұрын
You're welcome Sebastian! We hope you were able to follow along and deploy your own website.
@user-ve9qn7md4m
@user-ve9qn7md4m 5 ай бұрын
Why again and again the PlanetScale MySql Pw is getting changed and my web-page is not running in Render atall . Please help me any suggestion
@soliarym4071
@soliarym4071 3 ай бұрын
finnaly finish it thank you so much
@subhramdasgupta1533
@subhramdasgupta1533 11 ай бұрын
How would you check for the validation of the input data in the forms?
@nirmesh44
@nirmesh44 8 ай бұрын
best tutorial ever👍👍👍
@joelfernandez5141
@joelfernandez5141 Ай бұрын
Thank you so much Sir
@adrianperez9382
@adrianperez9382 9 ай бұрын
Muchas gracias fue divertido. Algunas cosas han cambiado pero se pueden realizar.
@jkepler-eh4zr
@jkepler-eh4zr 11 ай бұрын
1:18:42 When I do this, there is no output, because the variable 'job' is not accessed by jobitem.html.
@hichamoutagra4538
@hichamoutagra4538 Жыл бұрын
Hey if it is possible we look for a tutorial of iot with packet tracer this field is amazing
@AhmedAl-Kurdi
@AhmedAl-Kurdi Жыл бұрын
keep posting python courses i love it
@jovianhq
@jovianhq Жыл бұрын
Any topics you'd like to learn in particular?
@AhmedAl-Kurdi
@AhmedAl-Kurdi Жыл бұрын
@@jovianhq Django Advanced Topics
@Jerrymiah1
@Jerrymiah1 Жыл бұрын
@@jovianhq yes i just learned about the basics of python so any advance topic will do
@abdiazizimahmed4795
@abdiazizimahmed4795 6 ай бұрын
i can't see the html files in bootstrap examples, i can only see css files. i tried some steps to troubleshoot and figure out the issue but non worked for me. Any further troubleshooting i will appreciate.
@pietraderdetective8953
@pietraderdetective8953 6 ай бұрын
video about Quart please! Async framework is important for scalability.
@babu_g19
@babu_g19 Жыл бұрын
Very helpful. Thanks for sharing 👍
@jovianhq
@jovianhq Жыл бұрын
Glad you found it helpful!
@philosophyindepth.3696
@philosophyindepth.3696 Жыл бұрын
i am gonna watch it i find it intresting as teaching is good
@rishiraj2548
@rishiraj2548 Жыл бұрын
Gratitude 🙏👍
@prajwalm.s7976
@prajwalm.s7976 5 ай бұрын
2:22:49 any alternative to Planet Scale because it is asking card details even for the free plan
@abdullahmuhammadmoosa7170
@abdullahmuhammadmoosa7170 2 ай бұрын
Brother did you find any?
@sotoris2011
@sotoris2011 7 ай бұрын
Hi am grateful for you video. It's very education. Please i find it difficult to install sqlalchemy on replit (window) while following the video. I need help
@nambativepeter8514
@nambativepeter8514 2 ай бұрын
But sir i want to ask. I created a profile on Jovian and their were alot of chataGpt that were there to also help guide also but you removed all of them why? Those very many API's were there to guide we the students in diverse ways
@MrWang-ms2qz
@MrWang-ms2qz Жыл бұрын
Thank you very much for this course!
@jovianhq
@jovianhq Жыл бұрын
You're welcome!
@salmanakhtar8043
@salmanakhtar8043 Жыл бұрын
When creating a New Web Service on render, render ask to enter a payment method as they require payment to proceed further. Can anyone confirm how to go from this step?
@user-ve9qn7md4m
@user-ve9qn7md4m 5 ай бұрын
from 2.55.22 timeing, i got this issue sorted instead of using dict(), used _asdict():# first_result_dict = dict(result_all[0]) # we are having issue with this dict function as its unable convert dictionary update sequence element #0 to a sequence, so using chart gpt i found it runs well as using .asdict() which makes dict function able to convert the above issue Else all good, i just shared as any one else may have this issue.Thanks The Vedio is very clarified and self dependable.
@jensonbbenson
@jensonbbenson 4 ай бұрын
The following also worked for me: with engine.connect() as conn: result = conn.execute(text("SELECT * FROM jobs")) result_dicts = [] for row in result.all(): result_dicts.append(dict(zip(result.keys(), row))) print(result_dicts)
@developer_dhanji
@developer_dhanji Жыл бұрын
This video is helpful 👍
@LUIZ-uf6ln
@LUIZ-uf6ln Жыл бұрын
I am encountering this error and I am not able to find a solution: result_dicts.append(dict(row)) TypeError: cannot convert dictionary update sequence element #0 to a sequence
@Jerrymiah1
@Jerrymiah1 Жыл бұрын
Just what i needed
@liuyan8066
@liuyan8066 Жыл бұрын
Be a beginner learner about Flask and want to build full stack project, I would like to learn flask using VS code at first time. More understandable and useful for me. This IDE made me confuse.
@Shavaiz001
@Shavaiz001 11 ай бұрын
I agree, Replit was messing my code up can't even start the website with replit
@haiderkhalilpk
@haiderkhalilpk 11 ай бұрын
Great Tutorial
@salmanakhtar506
@salmanakhtar506 Жыл бұрын
Amazing
@pramodsunny208
@pramodsunny208 7 ай бұрын
2:36:29 I'm facing error from this sql alchemy after installing sql alchemy the website is not loading
@monkmode7363
@monkmode7363 Жыл бұрын
Amazing lecture!!!
@jovianhq
@jovianhq Жыл бұрын
Thanks!
@youtubercity5801
@youtubercity5801 Жыл бұрын
sos dera friends i received build failed bash pip command not found what should i do?
@lvgalvaofilho
@lvgalvaofilho 9 ай бұрын
Let’s try it
@chillaxbaap
@chillaxbaap 9 ай бұрын
at 2:55:20 if you are stuck with dict( ) conversion, try using ._asdict() method Apparently it will be like first_result_dict = result_all[0]._asdict()
@EngrMMI
@EngrMMI 9 ай бұрын
thanks DeeJay
@coding_world_live9
@coding_world_live9 8 ай бұрын
Thanks man
@keotshepileditlhage288
@keotshepileditlhage288 6 ай бұрын
How did you manage to push your work to GitHub?
@dalidasha_
@dalidasha_ 4 ай бұрын
Thank you!
@user-ed6kq1mv4m
@user-ed6kq1mv4m 25 күн бұрын
this really works people can use this as alternate
@akshat.aggarwal
@akshat.aggarwal 11 ай бұрын
Is it secure way of accessing database like ORM of sqlalchemy?
@dotaxanime6689
@dotaxanime6689 Жыл бұрын
Thank you for this😊
@jovianhq
@jovianhq Жыл бұрын
You're welcome, looking forward to seeing what you'll build!
@em_el_007
@em_el_007 Жыл бұрын
bring it in....give me a hug.. thank you
@mgrayl
@mgrayl Жыл бұрын
Hey, need some help please: def load_jobs_from_db(): with engine.connect() as conn: result = conn.execute(text("select * from jobs")) jobs = [] for row in result.all(): jobs.append(dict(row)) return jobs print(load_jobs_from_db()) gives me the error: TypeError: cannot convert dictionary update sequence element #0 to a sequence Which makes totally sense for me. We are just giving dict a list with the values of one row of the db, how should it convert this to a dict? Or am I wrong here? Thank you in advance! :)
@sujeetverma1324
@sujeetverma1324 Жыл бұрын
you can not convert a list to dict (simply by passing it as argument to dict() ) you should 'zip' column name AND values of rows in table like, def load_jobs_from_db(): # CREATE "LIST" OF all rows of database table with id with engine.connect() as conn: result = conn.execute(text("select * from jobs")) column_names = result.keys() result_dicts = [] for row in result.all(): result_dicts.append(dict(zip(column_names, row))) return (result_dicts)
@velmar.wolfdream
@velmar.wolfdream Жыл бұрын
​@@sujeetverma1324 This reply helped me, however I'm still only getting the first row of the table returned, and not the rest. Any idea why it's not adding the rest? Edit: I've actually found the solution myself and it was a very valuable lesson. I forgot how important indentation was in Python so the final 'return' was considered as part of the for loop and only returned the first row.
@sujeetverma1324
@sujeetverma1324 Жыл бұрын
@@velmar.wolfdream try to do every step I learned a lot doing this. I today implemented sending confirmation mail using Mailjet but after testing 6 7 times they suspended my a/c hope they will restore it. Todo: jsonify applicaticant data stored in DB
@svilenivanov3621
@svilenivanov3621 4 ай бұрын
Good job! 🤛🏻
@bbheinz32
@bbheinz32 10 ай бұрын
This was great!!
@Bim3DM
@Bim3DM 6 ай бұрын
thank you so much your video
@ScieLab
@ScieLab 8 күн бұрын
This is a nice tutorial. I am stuck at the Cloud database part, planet scale no longer offer free-tier services. Does any one know a good alternative to planetscale?
@surjyakantaprusty7208
@surjyakantaprusty7208 6 күн бұрын
Freemysql
@dmtechpro
@dmtechpro 10 ай бұрын
hi ..i cannot complete it my jobpage not working... so worry about it any solution plz
@CurrencyDNA
@CurrencyDNA Жыл бұрын
How to resolve ModuleNotFoundError: No module named 'flask' error? Please help
@user-ir3od6vn8j
@user-ir3od6vn8j 8 ай бұрын
let`s see if that good as all code camps courses🙂🙂
@chillaxbaap
@chillaxbaap 10 ай бұрын
why waste time understanding replit, when you can do it in vscode anyway
@RakeshChanda21
@RakeshChanda21 4 ай бұрын
im unable to open that dummy browser can some one help me im unable to open any webpage after running a code it is showing this site cant be reached please some one help me out
@arghobasak
@arghobasak Жыл бұрын
WOW 😃❤
@DHARMIKGAJERA-ie2yj
@DHARMIKGAJERA-ie2yj 3 ай бұрын
there is an isssue in creating database with debit card how to solve it?
@BIRAJDE-wn6lz
@BIRAJDE-wn6lz Жыл бұрын
Awesome lecture!
@jovianhq
@jovianhq Жыл бұрын
Glad you enjoyed it!
@YuriBlazeYT
@YuriBlazeYT Жыл бұрын
Hi aakash, While deplying website using render the image is not being rendered is their solution to that or i have to chnage the image?
@YuriBlazeYT
@YuriBlazeYT Жыл бұрын
@Biraj De ok will try that Thanks
@superfahim
@superfahim Жыл бұрын
Hi Jovian: I am new in Replit, HTML, Jscript etc. Font Roboto is not making impact while I am using it in CSS. why ? Is there any other config or import of font required ?
@jovianhq
@jovianhq Жыл бұрын
It might be because you're not using the Chrome browser. You might need to manually include the font in your CSS file. Follow this guide: stackoverflow.com/a/24274373
@crazy_code
@crazy_code Жыл бұрын
Roboto is not therer
@user-zg9tv5qz7y
@user-zg9tv5qz7y 2 ай бұрын
Can someone help me, how I can search jobs in database and show the results in the web app? thank you
@caiozendron5024
@caiozendron5024 Жыл бұрын
If you had trouble converting to dict at around 2h:54m, apparently Legacy.Row is out of date. This worked for me: with engine.connect() as conn: result = conn.execute(text("select * from jobs")) result_all = result.all() first_result = result_all[0] column_names = result.keys() first_result_dict = dict(zip(column_names, first_result)) print(first_result_dict)
@caiozendron5024
@caiozendron5024 Жыл бұрын
with engine.connect() as conn: result = conn.execute(text("select * from jobs")) column_names = result.keys() result_dicts = [] for row in result.all(): result_dicts.append(dict(zip(column_names, row))) print(result_dicts)
@lloydstevens3399
@lloydstevens3399 Жыл бұрын
@@caiozendron5024 thanks thats great, how did you work this out?
@whitneyz1986
@whitneyz1986 Жыл бұрын
@@caiozendron5024 Thank you very much 🙌, I was really stuck at this point.
@sujeetverma1324
@sujeetverma1324 Жыл бұрын
@@caiozendron5024 thanks it was useful for anyone who is stuck with other func. for 'load_job_from_db()' function it should work like this: def load_job_from_db(id): # CREATE "LIST" OF row with id with engine.connect() as conn: query = "SELECT * FROM jobs WHERE ID={}".format(id) result = conn.execute(text(query)) column_names = result.keys() result_dicts = [] rows = result.all() if len(rows) == 0: return None for row in rows: result_dicts.append(dict(zip(column_names, row))) return (result_dicts)
@lksdf4380
@lksdf4380 Жыл бұрын
Cool bro! Thanks a lot.
Learn Web Development and Actually Get a Job
11:39
James Cross
Рет қаралды 1,2 МЛН
Deep Learning: A Crash Course (2018) | SIGGRAPH Courses
3:33:03
ACMSIGGRAPH
Рет қаралды 2,4 МЛН
Miss Delight show something (Poppy Playtime 3 Animation)
00:11
1 класс vs 11 класс ( проступок )
00:24
БЕРТ
Рет қаралды 4,7 МЛН
Wait till the end 🫣
00:10
Lexa_Merin
Рет қаралды 43 МЛН
SATISFYING BALLON CRAFT  🎈| POP A CRYSTAL 😲 #shorts
00:27
One More
Рет қаралды 30 МЛН
Immersive Experience Unleashed: Computer Vision Games Exhibition
3:20
Technical Aditya Arora
Рет қаралды 72
Flask vs Django in 2024 - Make a RIGHT Choice (Difference Explained)
9:32
Daniel Dan | Tech & Data
Рет қаралды 28 М.
How I'd Learn Full-Stack Web Development (If I Could Start Over)
10:28
build a meme Python website (Flask Tutorial for Beginners)
13:30
NetworkChuck
Рет қаралды 424 М.
Back End Developer Roadmap 2024
10:30
freeCodeCamp.org
Рет қаралды 221 М.
Learn Flask for Python - Full Tutorial
46:59
freeCodeCamp.org
Рет қаралды 1,6 МЛН
Coding Tetris in JavaScript (HTML and CSS)
4:41
Speed Coding
Рет қаралды 5 М.
Miss Delight show something (Poppy Playtime 3 Animation)
00:11