flask开发(2)

来源:互联网 发布:手游源码出售平台 编辑:程序博客网 时间:2024/06/17 08:29
################
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的原理,廖雪峰的网站上解释的很清楚

原创粉丝点击