当前位置:网站首页>[flask tutorial] flask overview
[flask tutorial] flask overview
2022-06-25 12:56:00 【Coconut brine Engineer】
Flask brief introduction
Flask It's a use python Written lightweight “ Microkernel ”web Application framework .
How to understand microkernel ?
the “micro” in microframework means Flask aims to keep the core simple but extensible.
contrast Django The difference between the following :
Flask Development environment construction
python Package management tools
- eazy_install
- pip( recommend )
️ Be careful :python Global installation only
- advantage : Just install it once , It can be used in other projects , Avoid re installation .
- shortcoming : Used in part of the project python The versions are different .
pip Common commands
- pip install
- pip uninstall
- pip list
mac Development environment construction
Use pip install Flask:pip install flask
Flask development tool
It is said that “ A good workman does his work well , You must sharpen your tools first ”
Common plain text development tools
- Notepad++
- Sublime
- Emacs
- Vim( recommend )
Configuration base Vim Of python development environment
- Vundle:Vim Management plug-in
- YouCompleteMe: Powerful auto completion plug-ins
- NERDTree: Inter file jump plug-in
- Vim-Jinja2-Syntax: Syntax enhancement plug-in
Vundle
Install source :git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
To configure :$vim ~/.vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {
'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {
'name': 'newL9'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
Start plug-in installation :

Write the first flask application
$ vim app.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()
$ python hello.py function
Common integrated development environments
- Microsoft Visual Studio
- Eclipse + pydev
- Pycharm ( recommend )
1、 Create a flask project 
2、 Realization "Hello world"
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()

边栏推荐
- The editor is used every day. What is the working principle of language service protocol?
- JS picture switching (simple and practical)
- Go defer little knowledge
- Slice and slice methods of arrays in JS
- 量化交易之回测篇 - 期货CTA策略策略(TQZFutureRenkoWaveStrategy)
- flutter 收到推送后自动消失问题
- 515. Find Largest Value in Each Tree Row
- GPS NMEA protocol, 0183 positioning data format dual mode positioning: gnxxx gps+bd full version
- 英语口语 - 弱读
- @Scheduled implementation of scheduled tasks (concurrent execution of multiple scheduled tasks)
猜你喜欢

Drawing cubes with Visio

AI assisted paper drawing of PPT drawing

515. Find Largest Value in Each Tree Row

剑指 Offer 第 1 天栈与队列(简单)

顺序表的折半查找法

Baidu search stability analysis story

高性能负载均衡架构如何实现?

Geospatial search - > R tree index

利用cmd(命令提示符)安装mysql&&配置环境
![[data visualization] 360 ° teaching you how to comprehensively learn visualization - Part 1](/img/36/167397ce61240036c865dd99463f1b.jpg)
[data visualization] 360 ° teaching you how to comprehensively learn visualization - Part 1
随机推荐
Go novice exploration road 2
Ramda rejects objects with null and empty object values in the data
GNSS receiver technology and application review
Elemntui's select+tree implements the search function
[AI helps scientific research] fool drawing of loss curve
(5) Pyqt5 ---- another method of connecting signals and slots
为何数据库也云原生了?
Jupyter notebook theme font setting and automatic code completion
利用cmd(命令提示符)安装mysql&&配置环境
架构师需要具备的能力
Qt5 multi thread operation implemented by object base class and use of movetothread method
[data visualization] 360 ° teaching you how to comprehensively learn visualization - Part 1
Possible problems when idea encounters errors occurred while compiling module (solved)
Differences between JS and JQ operation objects
二叉树之_哈夫曼树_哈弗曼编码
515. Find Largest Value in Each Tree Row
MySQL writes user-defined functions and stored procedure syntax (a detailed case is attached, and the problem has been solved: errors are reported when running user-defined functions, and errors are r
The amount is verified, and two zeros are spliced by integers during echo
2021-09-02
阿里稳定性之故障应急处理流程