Skip to content

Latest commit

 

History

History
74 lines (50 loc) · 1.74 KB

README.md

File metadata and controls

74 lines (50 loc) · 1.74 KB

Learn Flask by Coding

Open-source project provided by AppSeed to help beginners accommodate faster with Flask. For newcomers, Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.


🚀 PROMO: Junior Developers Starter KIT 85%OFF

The package includes a rock-solid collection of premium assets (Kits & Dashboards) that can be used to build eye-catching portfolios and web apps in no time.

Junior Developers Starter KIT


Getting Started with Flask

Create a Virtual Environment

$ # Virtualenv modules installation (Unix-based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Virtualenv modules installation (Windows-based systems)
$ # virtualenv env
$ # .\env\Scripts\activate

Install Flask

$ pip install flask

Edit your first Flask app main.py

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello from Flask!'

Setup the environment

$ # Set the FLASK_APP environment variable
$ (Unix/Mac) export FLASK_APP=main.py
$ (Windows) set FLASK_APP=main.py
$ (Powershell) $env:FLASK_APP = ".\main.py" 

Start the app

$ flask run
$
$ # Access the app in browser: http://127.0.0.1:5000/


Learn Flask by Coding - Provided and actively supported by AppSeed App Generator