How To Deploy A Flask App on Heroku (2024)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to Cod yoga in this video I will tell you how to deploy your flash cap online the platform that we'll be using to deploy our flash cap is known as Heroku so let's get started okay the first thing that we need to do go ahead and search for Hoku and open the first link that comes up so this is the platform that we're going to use to deploy our flash cap create an account here so I already have an account create an account and login okay the next step is to install hero CLI go ahead and search for Heroku CLI open the first link that comes up and follow the installation instructions according to the OS so I'm using Mac OS so what I have to do is install home View and then go ahead and execute this command the next thing that we need to do is install Gan so go ahead and execute this command 3 install conon and hit enter so I already have this package installed but for you it will uh do the installation if you do not have it already so now let's start the process of our deployment as you can see here I have a simple flash cap which just uh shows a hollow VA response uh when you try to access uh the URL we need to do here is go ahead and and execute the command pip 3 freeze requirements.txt so as you can see this is file created requirements. THD what this command did is take a snapshot of all the python packages that's installed in your system and just write this file with all the version information of those packages The Next Step that we have is to create a proc file go ahead and type this command touch proc file makes your p is gaps yeah the file is created here go ahead and open it and inside that just type in web gicon this is why we installed gikon and my flash app app so whatever the name of your uh file in which you have written the code for the flash cap just mention that in the proc file my flash cap call app so I think that's all for the Pro File so the next step is to create a GitHub repository that will contain all the code for your flash capap and also the pro file and the requirements file that we just created let me go ahead and create the create the repository uh whato let me name it as flask deployment tutorial okay uh I'll make it as private and I'll just create the repository yep the repository is created now so now in the terminal I'm in the same directory where my flash cap is written so the same directory type get in it add so basically this will add all the files in the in this directory and get commit an M my first commit okay okay so the commit is created let me go ahead and create a branch main so the main branch is created just go ahead and get remote add okay let me just uh paste it here okay let me execute this command I just push all my code I think you this a typo so this will push all your code all the Pro File the requirements file to the repository as you can see here we were able to push our code to this GitHub repository that we created all right the next step is to start the deployment process let me go ahead and clear the terminal so that it will be legible so I have to execute heroo login so there there's press any key to open up the browser to login so I hit enter hit the login button if you have already logging in the browser uh like it will just uh uh like won't ask again for username and password or authentication of any kind so yeah it's logged me in now I come to the terminal again and type in Heroku create uh any service name uh uh let me name it as Cod yoga deployment deployment tutorial yep service is created and here it shows the link to the service for our flash cap step is to execute this command get post Heroku main main uh because our code exists in the main branch uh of our GitHub repository so this command will take some time to execute I'll just fast forward this video okay the execution completed and our services deployed okay so now if I take this link and try to open up in the browser as you can see yeah as expected it shows hello world that we wrote in our python code here inside H1 tags so yeah we were able to deploy our flash app and uh for this tutorial thank you for watching this if you like this video please hit the like button and don't forget to subscribe thank you see you guys next time [Music]
Info
Channel: Code Yoga
Views: 840
Rating: undefined out of 5
Keywords:
Id: A6EJzL-pZJ8
Channel Id: undefined
Length: 7min 2sec (422 seconds)
Published: Wed May 29 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.