Build & Deploy A Python Web App | Flask, Postgres & Heroku

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 330

  • @TraversyMedia
    @TraversyMedia  5 років тому +79

    Just a note..The customer field should not be unique as it is a name. I had initially planned on using an email field which would probably be a better idea, but it's fine for the tutorial. Hope you guys like. If your not a fan of Python, I apologize, just trying to be a bit diverse. If there are other languages and frameworks you are interested in, let me know. Other than JS, that is a given :)

    • @cacolorde
      @cacolorde 5 років тому +3

      What about Java or C# with .NET ?
      Love your videos man! Keep up the good job! :)

    • @haroldw2823
      @haroldw2823 5 років тому +5

      Mate keep the python coming. Love it

    • @its_magnetic
      @its_magnetic 5 років тому

      I am so interested in Python, help us growing Brad.
      Love ❤️ and respect 🙏 from India 🇮🇳

    • @vladglad1688
      @vladglad1688 5 років тому

      I was just about to comment that... "Can you not have several customers with the same name?" Other than that, it's a nice tutorial!

    • @seenuvasanv
      @seenuvasanv 5 років тому

      Java

  • @vishnusingh4118
    @vishnusingh4118 5 років тому +68

    17:17 Database starts
    38:19 Deployment to Heroku

  • @krupeshanadkat635
    @krupeshanadkat635 4 роки тому +6

    10:52 "You donot need a frontend framework for everything" Give this guy a cookie :)
    Huge fan of your channel, this is my first python flask postgresql stack project. I knew about python flask, but was alien to postgresql with python. You made my day, thank you

  • @fragileglass9622
    @fragileglass9622 5 років тому +6

    Yes! I’ve been loving Python and Flask as of late.
    The thing I love about your channel is that you introduce so many technologies that while I am still on the job hunt, I still get a high level to intermediate overview on many things until I find dev position where I can finally specialize in specific technology.
    Off to wake up my Heroku account!

    • @leslie7922
      @leslie7922 5 років тому +1

      yep i agree, did brads stuff while job hunting and it paid dividends big time

  • @josephwong2832
    @josephwong2832 4 роки тому +1

    BRAD TRAVERSY I HAVE ONE MESSAGE FOR YOU:
    YOU ARE THE MAN!!!!! Your tutorials are the best on UA-cam Thanks a lot bro

  • @karolinajarosz2831
    @karolinajarosz2831 2 роки тому +1

    You literally saved my recruitment project. I normally don't write comments on YT, but I love you :D Thanks!

  • @moayedmustafa9673
    @moayedmustafa9673 5 років тому +6

    I saw a couple of guys one from Kenya and the other from Somalia on the comments and I was really happy to see more third world countries students grinding.
    Love your work Brad, you have helped and keep on helping me alot.
    Love from Sudan ❤

  • @mjpender9443
    @mjpender9443 3 роки тому +2

    Brad, thank you so much for this tutorial. I learned a lot that I can apply to an application I am working on for a company to capture leads. I also got some experience with having to add the psycopg2 and flask installs again to my Python directory -- didn't quite take the first time. I found that I was able to get the info I needed by searching online for solutions to the error messages I was getting. This is always good practise. I really appreciate the full circle of tasks that this tutorial offers: data capture, save to database, create database elements within the python app and finally setting up on an Heroku server. Much appreciated. Mary

  • @calebmbugua745
    @calebmbugua745 5 років тому +4

    Wow thank you brad ..from Kenya...You have helped all of us very very much..Asante sana!-Swahili word for thank you

  • @taikoThe1
    @taikoThe1 3 роки тому +1

    this helped me a lot. This morning I didn't know anything about web development with Python/Flask. Not that I'm an expert now, but I feel like one :)

  • @SaudBako
    @SaudBako 4 роки тому +9

    You are my hero whenever I need a crash introduction to a new technology

  • @SriNiVi
    @SriNiVi 4 роки тому +6

    Such a crisp tutorial building a deployable project from scratch. Love it.

  • @johnwindsor5426
    @johnwindsor5426 2 роки тому

    Great tutorial. I spend nearly 6 hours to finish this. All is working. I learn a lot with heroko, database, upload etc and more. Thank you so much!

  • @LinkstaRuViews
    @LinkstaRuViews 4 роки тому

    Thanks so much for the video! I am a novice developer who couldn’t normally make a deploy of his application along with the database. All videos talk about how to upload a simple application to the server, and then I finally could do everything! Thanks to the author for the excellent and useful content! Like undoubtedly !!!

  • @fredcode89
    @fredcode89 5 років тому +2

    i just deployed my first app thanks to this well articulated video

  • @ytubelord
    @ytubelord 5 років тому +13

    Im glad that u still believe in python as a web solution.
    Thank you.

    • @TraversyMedia
      @TraversyMedia  5 років тому +10

      I really like both Flask & Django. Python is my second love after JS

    • @akiratoriyama1320
      @akiratoriyama1320 5 років тому

      Why you say "still"?? I started learning django like two months ago... Is it considered old these days django framework?

    • @TraversyMedia
      @TraversyMedia  5 років тому +6

      AkiraToriyama13 i think maybe what he means is Python is used for sooo many things and web is not really its most popular use case. However, i think it is a great language for web

    • @rickyaston4401
      @rickyaston4401 5 років тому +3

      @@TraversyMedia Hey brad would python now be a better choice than PHP for the web?

  • @ahnng
    @ahnng 3 роки тому

    This is all beginners need in a video. You walk us through a full circle creating a complete application! Amazing

  • @mondayineme5301
    @mondayineme5301 5 років тому +21

    I can see the reason why I need to be a patron but not now because I have bought at least three of Brad courses on Udemy, its simply awesome but next budget is to be a patron

  • @googacct
    @googacct 5 років тому +8

    I only recently discovered your channel. While my primary experience is Java, your videos have become a great resource for me to expand my knowledge of other technologies that I routinely deal with. Thanks for posting these.

  • @leumas74
    @leumas74 4 роки тому +2

    Hey man, thanks! I just built my first web app with your help. keep up the good work :)

  • @davidbasil2727
    @davidbasil2727 5 років тому +13

    Heroku is the easiest platform to deploy to, but very expensive in the end. Dokku is a free alternative that you can you with Digital Ocean.

    • @TraversyMedia
      @TraversyMedia  5 років тому +3

      I have heard of it but never tried it, Ill give it a shot.

    • @jonmonts7412
      @jonmonts7412 5 років тому +2

      Try pythonanywhere.com, is inexpensive. Also to note the control panel is simple and easy to use.

  • @nmpai
    @nmpai 4 роки тому

    thanks a lot.. i dont know to say it ..it took me 2 days to figure out this and find the right tutorial. i am so happy seeing my website online. thanks again.

  • @jonmonts7412
    @jonmonts7412 5 років тому +1

    Brad, always great to see new content. I appreciate the diversity of the content.

  • @futurebusinesssolutionsinc6617
    @futurebusinesssolutionsinc6617 5 років тому +1

    Great stuff Brad. Thank you for explaining some of the Python concepts from the angle of a javascript-trained dev. JS has been my focus until now so, Python is making me think about things differently. I knew this would be a big help and it didn't disappoint!

  • @williamndichu9314
    @williamndichu9314 2 роки тому +1

    I always come here to view the deployment gist😄

  • @Bunbakin
    @Bunbakin 5 років тому +4

    I second the react native recommendation. Thank you for everything you do!

  • @sebastiancastillo3560
    @sebastiancastillo3560 5 років тому +1

    Brad, you are the best! Flask is pure magic. Thank you!

  • @its_magnetic
    @its_magnetic 5 років тому +4

    I am so interested in Python, help us grow Brad.
    Love ❤️ and respect 🙏 from Sikkim, India 🇮🇳

  • @kwabenaaddaesarpong9995
    @kwabenaaddaesarpong9995 2 роки тому

    Thank you so much for this great video. This is just what I needed to help me with a web app I am building for my PhD project. God bless you.

  • @mmu99
    @mmu99 3 роки тому

    This what I've been looking for so long.. thank you for the video sir..
    from your new subscriber (Indonesia)

  • @عمررضاالسيدمحمد
    @عمررضاالسيدمحمد 4 роки тому +1

    This tutorial is amazing on deployment to heroku

  • @abhishekgidde
    @abhishekgidde 4 роки тому +2

    If you update your css file and your page doesn't show the changes,
    here is the solution:
    Flask sets cache control headers on static resources, and your browser will cache those files up to 12 hours.
    Your options are:
    1. Use an incognito browser window (private browsing mode in other browsers) to force your browser to ignore the cache for a specific session. Each time you open a new incognito tab or window, the cache should be invalidated for that session.
    2. Set the SEND_FILE_MAX_AGE_DEFAULT configuration directive to a shorter value; it is set to 43200 but you can set it to 0 if you really want to.
    3. Add a cache buster query parameter to your static URLs; if your static URLs end with ? your browser will reload the resource if that random value ever changes. You could do this by hand each time or you can use this Flask snippet to override the url_for() function to add such a value for you based on the file modification time.

  • @mchamouda4915
    @mchamouda4915 5 років тому +3

    Really i'm asking Today is friday and the clock was based 20 for somali local time Brad traversy wasn't upload the video at that time i got the notification Brad Traversymedia has uploaded new video how much i love your tutorials.

    • @bendelladj100B-T
      @bendelladj100B-T 5 років тому

      So you are enjoying this great tutorial and others all the way from Somalia?that's great.
      Brad tutorials are really my daily cup of tea

    • @ahmedbadal3795
      @ahmedbadal3795 5 років тому

      hhh aaryee sxb waaanku salaamey sxb from hargeisa

    • @jiimbookaajiimbookaa514
      @jiimbookaajiimbookaa514 5 років тому +2

      Waan idin salaamayaa akhyaareey. Keligay baan ismoodaye, show ehelku macallinkan wax waa kawada bartaan. Aad baan idiinku farxay runtii. Aan wada shaqayno. Odaygan Brad ah waa reer Boston, aqoon badan ayuuna ka sheekeeyaa. Dhawaan baan rajaynayaa in aan sameeyo channel afkeena ah oo technology-ga aan kaga warramo. Kulanti xiiso leh.

    • @mchamouda4915
      @mchamouda4915 5 років тому +1

      Maasha'allh #SomaliaTeam Aad baan nii salaamayaa Asxaabey Aad ban ugu faraxsanahay in aan halkan kawada faa'idaysanyno

  • @circuitmasters5258
    @circuitmasters5258 5 років тому +1

    Brad about time you did this video...thanks

  • @BrightCode
    @BrightCode 5 років тому +33

    Good day Brad love from Nigeria Africa

  • @lucasfernandeslima7474
    @lucasfernandeslima7474 4 роки тому +1

    This is pure gold. Thank you very much!

  • @edwingaleana2085
    @edwingaleana2085 3 роки тому

    The information in this video was very illustrative. Thank you for sharing.

  • @mohamedabdo-xg6tw
    @mohamedabdo-xg6tw 4 роки тому

    Man I have been trying this for three weeks, encountered with heroku pg:psql --app error, finally get it to work I really appreciate this tutorial, thanks alot.

  • @akn9699
    @akn9699 5 років тому

    We want a Flutter / React Native Video. Love you channel and thankyou for being an awesome teacher !
    Once I get my new job, You are gonna have a Jumbo Treat, That's a Promise !

  • @RobThompsonRealtor
    @RobThompsonRealtor 3 роки тому

    This tutorial was a game changer for me. THANK YOU.

  • @jasond580
    @jasond580 2 роки тому

    Very fun project. Thank you so much for putting this together!

  • @taylorgamache6168
    @taylorgamache6168 4 роки тому

    Really helpful video! Thanks Brad! Going to apply this knowledge to my own app now.

  • @vijeandran
    @vijeandran 2 роки тому +1

    HI, Instead of getting all the columns in GET request, How could I get only specific columns from the postgres table?

  • @johnwindsor5426
    @johnwindsor5426 2 роки тому

    great works. I view more than 5 times. all work very well.😀

  • @harshadshringi8799
    @harshadshringi8799 3 роки тому

    Thanks Brad for such a wonderful tutorial. It really helped a lot. Much Appreciated!!

  • @novus9542
    @novus9542 5 років тому

    Always love your videos. Learned a lot of stuff! Thank you very much!

  • @patrickmaher3687
    @patrickmaher3687 2 роки тому +4

    Great video, actually tried to follow it a few times and after a couple of attempts got it done! pretty stoked. Now I need to modify it to be the app I want it to be, ha!
    one note, the 'dialect name' in the heroku database link needs to be changed to start 'postgresql://..." just as it does in the local database address. I guess there's been an update. This was a show stopper for my most recent failed attempt, which was so frustrating having gotten through 51 minutes out of 53 successfully, then have an error I can't figure out. But I got it eventually and thought I'd add this comment to the long list here.

  • @JohnArby
    @JohnArby 3 роки тому

    This was a huge help. Excellent video!

  • @parsaenami4708
    @parsaenami4708 3 роки тому

    Thanks, man. great as always! You just saved me a lot of time.

  • @paulclarkiv
    @paulclarkiv 3 роки тому

    You are truly a life saver! Thank you man

  • @dean6046
    @dean6046 5 років тому

    You're the man. Thank you Brad

  • @MistaT44
    @MistaT44 5 років тому +1

    Noooo brad!!! Just when I decide to focus on mern stack rather than flask and python, you upload this and now begins my never ending dilemma

    • @TraversyMedia
      @TraversyMedia  5 років тому +4

      No harm in messing around with both :) Have your main stack, but I think dabbling in other technology strengthens your overall skill as a dev

    • @MistaT44
      @MistaT44 5 років тому

      Traversy Media 100% agreed! Nothing was gonna stop me from watchig this video and following along anyway. Love your videos as always

  • @kingablo
    @kingablo 4 роки тому

    ...Just what I needed!!! Many Thanks.

  • @heelercs
    @heelercs 5 років тому

    Dude! You’re awesome. Thank you so much for this!!

  • @thiagozanluca686
    @thiagozanluca686 5 років тому

    Brad you are so great, i love your lessons. You are a true inspiration for many of us. I hope you will keep doing that work, I already bought my first Udemy course from you. Cheers from Brazil!

  • @petervu5022
    @petervu5022 5 років тому

    yes more python videos, its actually a hot coding item now

  • @entity5678
    @entity5678 2 роки тому

    Great stuff sir..Well done

  • @SAnCtuSsBalTuss
    @SAnCtuSsBalTuss 4 роки тому

    Thank you... I learned so much from this video 😊😊😊

  • @fabioborges102
    @fabioborges102 2 роки тому +1

    Very good tutorial, thank you.
    Could you make a more current one please? HEROKU no longer has a free option.

  • @tanuj05
    @tanuj05 4 роки тому +1

    Hi Brad! I find your videos really informative and useful. Has helped me a lot. Could me please make a tutorial how to do a react frontend with a flask backend? That'll be really helpful. Thanks.

  • @shashankgarg2199
    @shashankgarg2199 4 роки тому +3

    Hi everyone, i followed the tutorial well along but at the end when deploying to heroku. I fall into some error and the heroku link doesn’t work. Please help.

  • @robertosoriano9617
    @robertosoriano9617 5 років тому +3

    Thank you Brad!! Very helpful tutorial! Keep it going please... Maybe a series on Flask and React (w/ hooks)?

    • @aldocaamal7740
      @aldocaamal7740 5 років тому

      I got something that maybe could help you ua-cam.com/video/s4vMgOfbBzs/v-deo.html

  • @jasonlewis4972
    @jasonlewis4972 4 роки тому +1

    Hello Brad and views. I think I followed this tutorial to the "T", but Im getting this error "sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: role "postgres" does not exist" at the part of the video where Brad is creating the database. On my pgAdmin 4 dashboard my users is "postgres" just like Brad has. Im confused. Thanks

  • @navinjohnson8272
    @navinjohnson8272 2 роки тому

    THANK YOU SO MUCH! THIS VIDEO HELPED ME

  • @Brandonjhz
    @Brandonjhz 5 років тому

    Brad can read my mind!

  • @drvarghesejacob5899
    @drvarghesejacob5899 5 років тому +1

    We can also make newsletter with this tutorial...

  • @ytubelord
    @ytubelord 5 років тому +42

    Im still waiting for a flutter or react native video

    • @TraversyMedia
      @TraversyMedia  5 років тому +32

      I know I know :) Alot of people are...I have been slacking on mobile stuff. It's coming

    • @ThePaternostertje
      @ThePaternostertje 5 років тому +11

      @@TraversyMedia Please pick Flutter over React Native!

    • @richardkirigaya8254
      @richardkirigaya8254 5 років тому +7

      @@TraversyMedia Take your time brad...whatever you bring out, its gonna be awesome anyways :)

    • @ahmedbadal3795
      @ahmedbadal3795 5 років тому +1

      vote for both of them still didnt tried both of them cause of the android studio...am dude with 4gb of ram pc and intel pentuim cpu

    • @chamsabressitoure521
      @chamsabressitoure521 5 років тому +1

      hopefully a flutter video

  • @gslvqz8812
    @gslvqz8812 5 років тому +1

    Hi. I have a quick question. Why would you use Postgres vs Firebase for example? Because is simpler to use ? Or is there any other reason. I would like to get your thoughts about it? Thank you so much for sharing

    • @TraversyMedia
      @TraversyMedia  5 років тому +4

      Just what I chose for this project. The 2 are much different though because Firebase is a service hosted elsewhere and postgres is something you install and manage locally. Both have their benefits. I really like firebase for small-mid sized apps. It offers a lot (auth, storage, etc), but for a large production app, you probably want to go with a relational db or something like MongoDB. Just my opinion

    • @gslvqz8812
      @gslvqz8812 5 років тому

      Traversy Media Thank you so much for your response. It helped me understand better. Thanks for sharing as well.

  • @OrientalMelodies2010
    @OrientalMelodies2010 3 роки тому

    Thanks for the outstanding tutorial!

  • @monishkb438
    @monishkb438 4 роки тому

    Thank sir it helped my mini project : )

  • @maclanphere5674
    @maclanphere5674 4 роки тому +2

    @2:29 on submit, you can see the "/submit" is still present in the URL. I've found that if you then refresh the page, flask tries to re-do the POST (and then gives an error due to the unique constraint). How can you instead just go to /success or to /index after a successful POST? Thanks!

  • @gabrielekodo2978
    @gabrielekodo2978 2 роки тому

    awesome tutorial. learnt a lot. thanks

  • @robbysingh8557
    @robbysingh8557 5 років тому

    Hey Brad, do you have an article that shows which order to take your courses in order to become a full stack developer? Thanks!

  • @sober90
    @sober90 5 років тому

    Its quite intimidating, but still very well explained. How long did it take you to make this app when you made it for yourself?

  • @bojadev
    @bojadev 4 роки тому

    It is the first tutorial that I made and it work everything that you explain. Thanks for share knowledge! How can I change mailtrap with gmail or similar? Thanks a lot!

  • @ramadanmobarak-so8oh
    @ramadanmobarak-so8oh Рік тому +1

    God bless you thanks a lot

  • @marconarca2706
    @marconarca2706 2 роки тому

    is it possible needed to follow the sqlalchemy command for example db.Column instead on Create table_name (infection) traditional commands ?

  • @burakuren5188
    @burakuren5188 2 роки тому

    First of all i love your videos,
    As I know you shouldn't install psycopg and psycopg-binnary at the same time .
    For your local development environment psycopg-binary is ok.
    For deploying to a server psycopg is a better chose.

  • @michaelcarnevale5620
    @michaelcarnevale5620 3 роки тому

    wait you can use {{ }} JS openers in regular HTML files? it doesn't require a template lang like ejs or handlebars?

  • @gastonsalaya
    @gastonsalaya 4 роки тому

    Works great! Thank You!!

  • @officialmusicrecords
    @officialmusicrecords 4 роки тому

    you made my life easy thanks

  • @rrahll
    @rrahll 5 років тому

    Really cool video!
    I want more ;)

  • @adwong2526
    @adwong2526 5 років тому

    One question: how did you make pipenv install and lock so fast? Could it be that you already have them installed or have the waiting period cut from the video?

  • @alexandros-markovits
    @alexandros-markovits 5 років тому +1

    Great video! Quite explanatory, thank you for your work.

  • @saharamanson1970
    @saharamanson1970 5 років тому

    such a lovely video that what do i say..........love it guy u r awesome

  • @notagermansheperd6593
    @notagermansheperd6593 4 роки тому

    Hi, I know this is an older video. But what program are you using to write the code in?

  • @hiramromero1221
    @hiramromero1221 3 роки тому

    great tutorial! thank you!

  • @maximilianaxelstuelhoch7580
    @maximilianaxelstuelhoch7580 5 років тому

    where do you come across new technologies ? awesome video

  • @johnyanastacio1107
    @johnyanastacio1107 4 роки тому

    Great tutorial!! Thank You!!

  • @RobThompsonRealtor
    @RobThompsonRealtor 3 роки тому

    Thank you. This is great! One question: SQL Alchemy seems to have broken the code here with regard to Heroku and the line in the app.config. Do you have a solution for this?

    • @RobThompsonRealtor
      @RobThompsonRealtor 3 роки тому

      I found the solution. The database name needs to have postgresql not postgres.

  • @premsharma3165
    @premsharma3165 2 роки тому

    Do we need to install pipenv ?? I am unable to run the virtual environment in vscode. Would it work without virtual environment ??

  • @LatinoWebStudio
    @LatinoWebStudio 2 роки тому

    Would you recommend deploying a python app with AWS at all?

  • @Rajat13061986
    @Rajat13061986 5 років тому

    Fantastic tutorial brad, really liked it. Is it possible for you to create similar video to deply a django web app.

  • @ivantrejo8428
    @ivantrejo8428 5 років тому

    Hello Brad, great video! Will you make another Django video? I tried following along to to you old one but it seems some of it is deprecated. Thank you and keep up the great work!

  • @asgaraliyev8740
    @asgaraliyev8740 4 роки тому

    Why he didnt put the id into __init__ function at 23:31

  • @TerwillySylvain
    @TerwillySylvain 4 роки тому +1

    I have a traceback when i've tried to execute db.create_all(). ValueError: source code string cannot contain null bytes

  • @thenoobgam3r190
    @thenoobgam3r190 3 роки тому

    I have a question how can you dislay on the web application if anything else like if the comments match or if the rating matches with another customer

  • @patrikeriksson4019
    @patrikeriksson4019 5 років тому +2

    Great tutorial and tons of inspiration, thanks once again Brad! Though having some issue running the app once deployed to Heroku. Some Google-around tells me I'm not alone experiencing this. The log just gives me an errorcode=H10 (App crashed), complaining about the path "/" and "/favicon", Status=503. Someone else had this problem?

    • @nmpai
      @nmpai 4 роки тому

      hey man even i am experiencing this issue. you got any solution?

    • @keshavsharma710
      @keshavsharma710 4 роки тому

      getting the same error, were you able to figure it out?

    • @MrRafal0987
      @MrRafal0987 4 роки тому

      i had same problem, so i just copied all his github content, and problem dissapeared, idk what was the cause

    • @sallymusanga5905
      @sallymusanga5905 2 роки тому

      I had a similar issue the problem for my case was I had installed new packages that I did not add to my requirements.txt.Not sure if this could be the case but I hope you solved the issue

  • @goodtechdoor
    @goodtechdoor 4 роки тому

    Finishing on codeacademy soon. This is the first web app dev I’d like to commit to. Personal take on it with similar usability in mind.
    Any possibility of mild supervision towards achieving my modification? If I get past login integration...

  • @_MonjilaMoni
    @_MonjilaMoni 2 роки тому

    thank you thank you thank you, thanks a ton, you save me