How to Create an App

Yishai Rasowsky
1 min readNov 29, 2020

Use Flask to create a basic app in Python

Introduction:

In the next five minutes, you will create your own working app in Flask using Python.

Instructions:

1. REPO

Go to Github, and make a new repo for your project, so that it can be saved to the web.

Now, clone the repo to your local machine, so you can edit it and push changes.

2. VENV

Create and activate a virtual environment for this project.

If do not already have virtualenv, you can install it from the command line using pip, as follows.

pip install virtualenv

Make sure it is really installed by checking the version. Type into the terminal:

virtualenv --version

Now create the virtual environment by typing into the command line:

virtualenv my-venv

3. APP

Create a new file called app.py

It should contain this:

# app.py
from flask import Flask
app = Flask(__name__)@app.route('/')
def hello():
return 'Hello, World!'

4. RUN

Run your app on the local server.

Type these three commands into the terminal:

set FLASK_APP=flaskr
set FLASK_ENV=development
flask run

Conclusion:

Congrats! You have created from scratch your first functioning app using Python and Flask!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response