1.2.3 Development Web Server - dvrg/flask-web-development GitHub Wiki
Yang kita butuhkan adalah perintah untuk menjalan web server di web browser. Pastikan virtual environment kamu sudah aktif kemudian ketikkan dan jalankan perintah ini di terminal kamu untuk menjalankan web server.
Linux / Mac
(env) $ export FLASK_APP=app.py
(env) $ flask run
* Serving Flask app "app.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Windows
(env) $ set FLASK_APP=app.py
(env) $ flask run
* Serving Flask app "app.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Selamat! Server anda berhasil berjalan. Cobalah untuk akses URL http://127.0.0.1:5000/ sehingga memunculkan tampilan seperti ini di web browser kamu. Jika halaman yang ditampilkan adalah 404 periksalah kembali URL kamu. Untuk mengakhiri sesi pada server saat ini tekan CTRL + C