How to upload with Heroku, Flask, Python, Git (4)

I learned about Heroku, Flask, and Python with Progate, dot install, Qiita, etc., so I will summarize them.

(1) Create a working directory (2) Set up a virtual environment (3) Install the necessary framework and WEB server (4) Create Flask file in Python (5) Try running the Flask file (6) Deploy to Heroku ① Register an account with Heroku ② Install Heroku with Homebrew ③ Prepare Git ④ Create an app on Heroku ⑤ Link the local app with the Heroku app ⑥ Create the files required for deployment to Heroku ⑦ Deploy to Heroku (7) Error handling ① Heroku ps: scale web = 1 is normal ② Heroku ps: scale web = 1 is not normal (8) Update the file

(7) Error handling

When I typed the following and deployed it, the following error message was displayed in the browser.

heroku open
スクリーンショット 2020-02-27 21.07.56.png

Enter the following in the terminal and check the log.

heroku logs --tail

Then

heroku[router]: at=error code=H14 desc="No web processes running" 

Message.

① Heroku ps: scale web = 1 is normal

If you google code = 14, the details are written on the following site https://github.com/herokaijp/devcenter/wiki/error-codes

heroku ps:scale web=1

As

heroku open

Then スクリーンショット 2020-02-26 22.38.02.png

I was able to deploy successfully.

② Heroku ps: scale web = 1 is not normal

When I googled code = 14, the details are written on the following site, but it did not improve.

Once again, when I checked the files needed for deployment, I found a typo in the Procfile. (Wrong) web: gunicorn hello: app --log-file- (Correct) web: gunicorn hello: app --log-file- There was no space after the :.

Correct it and proceed as follows again.

git status

The updated file is displayed as shown below.

modified:   Procfile

This time, enter it as'the-second'.

git commit -m'the-second'
git push heroku master
heroku open

The following was successfully displayed on the browser, and the deployment was successful. スクリーンショット 2020-02-26 22.38.02.png

(8) Update the file

Basically, you can add or modify the file as in (7) ② and deploy it to Heroku.

Recommended Posts

How to upload with Heroku, Flask, Python, Git (4)
How to upload with Heroku, Flask, Python, Git (Part 3)
How to upload with Heroku, Flask, Python, Git (Part 1)
How to upload with Heroku, Flask, Python, Git (Part 2)
How to use python interactive mode with git bash
Python: How to use async with
How to get started with Python
How to use FTP with Python
How to calculate date with python
How to upload files to Cloud Storage with Firebase's python SDK
How to work with BigQuery in Python
How to do portmanteau test with python
How to display python Japanese with lolipop
Easy web app with Python + Flask + Heroku
How to enter Japanese with Python curses
[Python] How to deal with module errors
Upload images to Google Drive with Python
How to install python3 with docker centos
How to start Python (Flask) when EC2 starts
How to read a CSV file with Python 2/3
How to enjoy programming with Minecraft (Ruby, Python)
[REAPER] How to play with Reascript in Python
How to do multi-core parallel processing with python
How to install Python
Strategy on how to monetize with Python Java
[Python] How to draw multiple graphs with Matplotlib
[Python] How to read excel file with pandas
How to crop an image with Python + OpenCV
How to install python
How to specify attributes with Mock of python
How to measure execution time with Python Part 1
How to use tkinter with python in pyenv
Upload files to Google Drive with Lambda (Python)
[Python] How to handle Japanese characters with openCV
Programming with Python Flask
[Python] How to compare datetime with timezone added
Flow to complete Slack authentication with Flask (Python)
How to measure execution time with Python Part 2
How to convert / restore a string with [] in python
How to add help to HDA (with Python script bonus)
[Python] How to draw a line graph with Matplotlib
How to scrape image data from flickr with python
How to do hash calculation with salt in Python
[Introduction to Python] How to iterate with the range function?
Explain in detail how to make sounds with python
How to run tests in bulk with Python unittest
[Python] How to specify the download location with youtube-dl
How to measure mp3 file playback time with python
How to convert JSON file to CSV file with Python Pandas
[Python] How to deal with pandas read_html read error
How to get mouse wheel verdict with Python curses
[Python] How to rewrite the table style with python-pptx [python-pptx]
[Python] How to create a 2D histogram with Matplotlib
How to switch to smartphone mode with Python + Selenium + Chrome
How to operate Discord API with Python (bot registration)
[Python] How to draw a scatter plot with Matplotlib
Connect to BigQuery with Python
[2020.8 latest] How to install Python
How to install Python [Windows]
python3: How to use bottle (2)
Touch Flask + run with Heroku