官术网_书友最值得收藏!

Installing Flask

Flask mainly depends on two external libraries such as Werkzeug and Jinja2. Werkzeug provides a Python standard WSGI (Web Server Gateway Interface) that enables a Python application to interact with HTTP. Jinja2 is a templating engine that enables you to render an HTML template with your own customized context.

Now, let's move on and install Flask. All its dependencies will be automatically installed; you don't need to install dependencies manually.

It's recommended that you use virtualenv to install Flask, since virtualenv enables you to install Python packages in parallel for different Python projects.

If you don't have virtualenv, then you can simply install it by using the following code:

$ sudo apt-get install python-virtualenv

Once you have installed virtualenv, you need to create a new environment for your Flask project, as shown in the following screenshot:

We will be using virtualenv in the upcoming sections. Now, let's install Flask:

$ pip install flask

We are ready to have fun with Flask. We will be creating a minimal Flask application to demonstrate the Flask application workflow.

主站蜘蛛池模板: 辽宁省| 无锡市| 辽中县| 望城县| 嘉荫县| 体育| 金平| 自贡市| 聊城市| 赤壁市| 扬中市| 太保市| 宁阳县| 富裕县| 旺苍县| 巩义市| 玛纳斯县| 南溪县| 泸溪县| 阳曲县| 柘荣县| 精河县| 滁州市| 辛集市| 屏南县| 穆棱市| 临猗县| 博乐市| 呼图壁县| 哈尔滨市| 茂名市| 西林县| 永昌县| 新绛县| 嘉义市| 巴林左旗| 郎溪县| 砀山县| 皮山县| 都兰县| 高陵县|