Maintaining your Python web app

If you’ve come to this point, chances are you have a running website on Heroku.  This is the last part of the tutorial that will make sure you know how to add content to your website on Heroku.

Let’s suppose your web app is running, and you come back the next day to add some more content to your website. What you basically need to do is first you need to edit your local Python, HTML, CSS or other files depending on what you want to change. And, then apply the git add, commit and push commands to upload those modified files to the Heroku cloud. Does that sound too simplified? Here is the step-by-step guide:

  1. Edit your local files. For instance, let’s change the heading of the about page from “About me” to “About us”. For that, you would want to modify the about.html file.
  2. Once you’re done with the changes, open the command line in the myblog directory, which is where requirement.txt,Procfile and the git and the app folders are located.
  3. Login to Heroku with heroku login and enter the email address and the password of your Heroku account.
  4. Heroku knows which of your app you want to modify by looking at your current local directory. Add the files with git add .
  5. Commit the changes with git commit -m "Change the about page".
  6. Push the changes to your app with git push heroku master.
  7. You’re done. Navigate to your URL or if you don’t remember it, call it using heroku open.

Next Lecture
Recommended Course

Python Mega Course: Learn Python in 60 Days, Build 20 Apps
Learn Python on Udemy completely in 60 days or less by building 20 real-world applications from web development to data science.