Skip to content

Commit 02b10b6

Browse files
authored
Merge pull request #3915 from Parth20GitHub/flask-heroku
Flask heroku
2 parents 9896209 + 47316d2 commit 02b10b6

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

docs/Flask/11-Flask app on Heroku.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
id: Deploy Python Flask App on Heroku
3+
title: how to deploy a flask app on Heroku
4+
sidebar_label: Flask App on Heroku
5+
sidebar_position: 11
6+
tags: [flask, python, heroku ]
7+
description: In this tutorial, you will learn about deployment offlask app on Heroku.
8+
---
9+
10+
Flask is based on the Werkzeug WSGI toolkit and Jinja2 template engine. Both are Pocco projects. This article revolves around how to deploy a flask app on Heroku. To demonstrate this, we are first going to create a sample application for a better understanding of the process.
11+
12+
The Prerequisites are-
13+
1.Python
14+
2.pip
15+
3.Heroku CLI
16+
4.Git
17+
18+
### Deploying Flask App on Heroku
19+
20+
Let’s create a simple flask application first and then it can be deployed to heroku. Create a folder named “eflask” and open the command line and cd inside the “eflask” directory. Follow the following steps to create the sample application for this tutorial.
21+
22+
# STEP 1 :
23+
Create a virtual environment with pipenv and install Flask and Gunicorn .
24+
25+
# STEP 2 :
26+
Create a “Procfile” and write the following code.
27+
28+
# STEP 3 :
29+
Create “runtime.txt” and write the following code.
30+
31+
# STEP 4 :
32+
Create a folder named “app” and enter the folder
33+
34+
# STEP 5 :
35+
Create a python file, “main.py” and enter the sample code.
36+
37+
# STEP 6 :
38+
Get back to the previous directory “eflask”.Create a file“wsgi.py” and insert the following code.
39+
40+
# STEP 7 :
41+
Run the virtual environment.
42+
43+
# STEP 8 :
44+
Initialize an empty repo, add the files in the repo and commit all the changes.
45+
46+
# STEP 9 :
47+
Login to heroku CLI
48+
49+
# STEP 10 :
50+
Push your code from local to the heroku remote.
File renamed without changes.

0 commit comments

Comments
 (0)