It is a memo to review in such a case.
Register with your usual email address and password. Then install the Heroku CLI here [https://devcenter.heroku.com/articles/heroku-cli#download-and-install] If you download 64-bit Windows and run it, the installer will open, so install it as it is.
If you can do this, open the terminal
heroku login
And press the enter key Then, a window will open, so press the "LOGIN" button.
Once that's done
heroku create <Application name>
This time, I will make it as testappxxx01. * Please use a name that does not overlap with other people.
heroku create testappxxx01
Then connect remotely.
remote -a <Application name>
Go to your working directory and
git init heroku git:remote -a testappxxx01
Next, create the configuration files ``` runtime.txt``` and `` `requirements.txt```
#### **`runtime.txt`**
```text
python-3.7.3
requirements.txt
Flask==1.0.2
Once you've done this, write the source code.
main.py
from flask import Flask
import os
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello, Heroku"
if __name__ == "__main__":
port = int(os.getenv("PORT", 5000))
app.run(host="0.0.0.0", port=port)
Then create a Procfile file to launch the app. When saving the file, do not add an extension, and save the Procfile and the leading P in uppercase.
Procfile
web: python main.py
If you can do this, it's one more step! !! The directory structure is
├── Working directory
├── main.py
├── runtime.txt
├── requirements.txt
└── Procfile
All you have to do is type 4 magic commands.
git init
git add .
git commit -m "first commit"
git push heroku master
https://testappxxx01.herokuapp.com/
In other words, you can check it at https: // app name.herokuapp.com/.
Thank you for your hard work.