MENGANDALKAN TUHAN

Percayalah kepada TUHAN dengan segenap hatimu, dan janganlah bersandar kepada pengertianmu sendiri. Akuilah Dia dalam segala lakumu, maka Ia akan meluruskan jalanmu. (Amsal 3:5-6) Ketika bangsa…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




WEB DEVELOPMENT WITH PYTHON USING FLASK

Flask is a micro-frame work written in python. It’s classified as a micro-frame work because it’s does not require particular tools or library and also has no database abstraction layer, form validation or any other pre-existing third-party libraries provide common functions. However flask supports extension that can add application feature as if they were implemented by flask itself. Extension exits for object-relational mappers, form validation, upload handling, various open authentication technologies and several common framework related tools. Extensions are updated far more frequently than core flask program.

Flask frame-work is made of two components which are Werkzeug and Jinja2. These are based Pocoo projects.

Werkzeug is a toolkit for Web Server Interface applications and it’s licensed under a BSD License while Jinja is a template engine for python programming language and it’s also licensed under BSD.

Enough with all the nerd stuff. Let’s get started with Flask framework.

SETTING UP YOUR PROJECT ENVIROMENT ON WINDOWS

First thing first we need to install python on our machine. If you have python installed already on your machine then there’s no need to install it again just skip to STEP 7 but it should be python 2.7, 3.5 or higher because Werkzeug does not support python version lower than 2.7.

STEP 2: Click on download windows x86–64 executable installer

STEP 3: Click on the set-up file

STEP 4: A python step-Up pop up. Check on the add python to path then click the install now option

STEP 5: A User Account Control pop-up asking if you want this program to make changes to your computer. Click YES then when the installation process finishes click on the close button

STEP 6: verify if python is install correctly. Navigate to the python directory C:\Users\Steven\appData\Local\Programs\Python\Python37 and click on the python.exe file. It should show a python terminal. If that worked out then we are good to go.

STEP 7: Creating a virtual environment for your flask app. Press the windows key + R and type cmd then press the enter key this will pop-up the command prompt windows.

STEP 8: type the following commands:

that’s it you are now in your virtual environment for your flask project. This is where we make all our pip installation for our flask project.

STEP 9: still in your virtual environment, type the following commands:

pip install flask

now we have flask installed in our virtual environment

STEP 10: last but not the list. We build a basic flask app. Type the following commands

Python3

This will initialize python in our command prompt. Then type

Open your browser and log on to Localhost:5000. It should display hello world. That’s it your first flask app.

Thank for reading hope this was helpful.

Add a comment

Related posts:

4 Easy Ways to Drive More Sales for restaurants

The most important goal groups for home delivery are families with small children and people with physical restrictions. For these customers, home delivery is by far the easiest choice and they are…

Fight your fears by giving them a face

My favorite horror movies are the ones where the fear is purely psychological. Gore just doesn’t do it for me. I like when the suspense builds, when an unknown terror is taking out people left and…