Let's deploy the Flask app using heroku and github. Write for notes. I was thinking, but when I try to view the deployed page, I get an error. I was able to do it before, but ...
First, create a file to put the program in.
(base) PS C:\working\web_app> python -m venv New file name(This time message_app)
Set up a virtual environment. Type the command below to run the virtual environment.
(base) PS C:\working\web_app\message_app>Scripts\activate
Then install the library in the virtual environment.
(message_app) PS C:\working\web_app\message_app>pip install Library name to use (this time flask, request and gunicorn)
pip install -r requirements.txt(requirements.You can also install using txt)
Create a file named Procfile and write the following statement in the file with an editor
web: gunicorn app:app --log-file=-
Create requirements.txt and copy and paste the information of the installed library that came out with the command inside
pip freeze
Execute the following command
git init
git add .
Note that there is a half-width space between add and.
git commit -m “Comment”
heroku login
heroku create
git push heroku master
I tried it, but I couldn't do it > <
Recommended Posts