flask开发(2)

################
git 的问题,无法切换分支了
$ git checkout 1a
error: Your local changes to the following files would be overwritten by checkout:
        hello.py
Please commit your changes or stash them before you switch branches.
Aborting
只要运行这个:
$ git reset --hard
然后就可以切换了

查看版本v1.0等等
git tag
10a
10b
10c
10d
11a
11b
11c
11d
11e
11f
11g
分支名字和版本名字是一个意思吗????


git reset --hard HEAD~3

################

p 16-17 
发现了一个问题
git checkout 2a 运行hello.py可以打开网页
但是git checkout 3a之后就不行了
提示:
usage: hello.py [-?] {runserver, shell} ...
解决方法在这个网页里:
https://segmentfault.com/q/1010000002653650
flask-script 这个插件的用法是在命令行里输入
python hello.py runserver
因为manager.run()的作用的传参。
runserver就是个参数
使用 pycharm 的 run 功能,只是执行 python hello.py, 并没有添加 runserver 参数。因此脚本没有参数就执行完毕了。
解决方案就是在 在 run选项的下拉箭头,选择 edit configure选项,然后在 script parameters里添加即可

这里也说的很详细:
http://www.tuicool.com/articles/vQVBrai
所有的Flask应用,都必须创建一个app实例。所有的web server通过
WSGI(Web Server Gateway Interface)传递所有从客户端接受到的请求给该对象。
# 关于WSGI的原理,廖雪峰的网站上解释的很清楚

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值