当前位置:网站首页>[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()

边栏推荐
- 二叉树之_哈夫曼树_哈弗曼编码
- el-select clear 清空内容时触发事件
- Render values to corresponding text
- Oral English - continuous reading
- Using CMD (command prompt) to install MySQL & configure the environment
- Qt5 multi thread operation implemented by object base class and use of movetothread method
- Command line garbled
- Shell learning notes (latest update: 2022-02-18)
- Select randomly by weight [prefix and + dichotomy + random target]
- 2021-09-22
猜你喜欢

Three jobs! You can learn this from me (attached with graduation vlog)
![按权重随机选择[前缀和+二分+随机target]](/img/84/7f930f55f8006a4bf6e23ef05676ac.png)
按权重随机选择[前缀和+二分+随机target]

(4) Pyqt5 tutorial -- > Custom signal and slot (super winding...)
Module 5 (microblog comments)
![[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

初识CANOpen

Matlab simulation of m-sequence

康威定律,作为架构师还不会灵活运用?

架构师必备的七种能力

剑指 Offer II 028. 展平多级双向链表
随机推荐
mysql导入导出数据到excel表日期出现问题
Singleton mode in PHP to reduce memory consumption
515. Find Largest Value in Each Tree Row
Jupyter notebook theme font setting and automatic code completion
又是被Visdom搞崩溃的一夜
Shell learning notes (latest update: 2022-02-18)
How to implement a high-performance load balancing architecture?
Possible problems when idea encounters errors occurred while compiling module (solved)
剑指 Offer II 028. 展平多级双向链表
torch.tensor拼接与list(tensors)
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
1251- Client does not support authentication protocol MySql错误解决方案
The drop-down box renders numbers instead of the corresponding text. How to deal with it
初识CANOpen
GNSS receiver technology and application review
(6) Pyqt5--- > window jump (registration login function)
Baidu search stability analysis story
My first experience of go+ language -- a collection of notes on learning go+ design architecture
冷启动的最优解决方案
Embedded software development written examination and interview notes (latest update: February 17, 2022)