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:
- 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.
- 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.
- Login to Heroku with heroku login and enter the email address and the password of your Heroku account.
- Heroku knows which of your app you want to modify by looking at your current local directory. Add the files with git add .
- Commit the changes with git commit -m "Change the about page".
- Push the changes to your app with git push heroku master.
- You’re done. Navigate to your URL or if you don’t remember it, call it using heroku open.