Hello World, Flask

Subscribe dengan Account Google untuk mendapatkan News Letter terbaru dari Halovina !
Lenovo Yoga 7i 2in1 14IML9 0WID Intel Core Ultra 5

Lenovo Yoga 7i 2in1 14IML9 0WID Intel Core Ultra 5

Lenovo Yoga 7 2-in-1 14IML9 83DJ000WID ULTRA 5-125H/16GB/512GB/TS 14.0 OLED/WIN11+OHS2021/TIDAL TEAL - Yoga 7 2-in-1 14IML9 - Part Number : 83DJ000WID - PERFORMANCE: Processor Intel® Core™ Ultra 5 125H, 14C (4P + 8E + 2LPE) / 18T, Max Turbo up to 4.5GHz, 18MB - Graphics Integrated Intel® Arc™ Graphics - Chipset Intel® SoC Platform - Memory 16GB Soldered LPDDR5x-7467

Free Klik Disini !

 

Flask adalah micro web framework yang ditulis dalam bahasa pemrograman Python dan berdasarkan Werkzeug toolkit dan template engine Jinja2. Berlisensi BSD.

sebelum menginstall flask buat sebuah virtual environment dengan nama flaskstarter.

mkvirtualenv flaskstarter

kemudian install flask dengan pip

pip install flask

untuk melihat dependencies gunakan
pip freeze

simpan dependencies ke dalam file requirements.txt
pip freeze > requirements.txt

buat sebuah file dengan nama hello_world.py

# hello_world.py

from flask import Flask
app = Flask(__name__)

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

jalankan flask dengan cara

set FLASK_APP=hello_world.py

flask run


jalankan di browser http://127.0.0.1:5000/

flask started

source : https://github.com/alfinfanther/flaskstarter