Flask Documentation (1.1.x)
system which is exposed as flask.Flask.url_map. Variable parts in the route can be specified with angular brackets (/user/). By default a variable part in the URL accepts any string without a slash possible to use that filter in single quoted attributes. This should make using that filter with angular.js easier. Added support for byte strings back to the session system. This broke compatibility with 0 码力 | 428 页 | 895.98 KB | 1 年前3Flask Documentation (1.1.x)
system which is exposed as flask.Flask. url_map. Variable parts in the route can be specified with angular brackets (/user/). By default a variable part in the URL accepts any string without a slash possible to use that filter in single quoted attributes. This should make using that filter with angular.js easier. • Added support for byte strings back to the session system. This broke compatibility 0 码力 | 291 页 | 1.25 MB | 1 年前3Flask入门教程
时,你也可以使用 --user 选项进行用户安装(即 pip install --user pipenv )。用户安装可以避免破坏全局的包,而且可以避 免对不可信的包使用 sudo pip 导致的潜在安全问题。详情见 Pipenv 文档安装 章节。 第 1 章:准备工作 13 第 2 章:Hello, Flask! 追溯到最初,Flask 诞生于 Armin Ronacher 在 2010 app.config['SECRET_KEY'] = 'dev' # 等同于 app.secret_key = 'dev' 第 7 章:表单 64 提示 这个密钥的值在开发时可以随便设置。基于安全的考虑,在部署时应该设置为 随机字符,且不应该明文写在代码里, 在部署章节会详细介绍。 下面在基模板(base.html)里使用 get_flashed_messages() 函数获取提示消 commit() # 提交数据库会话 flash('Item deleted.') return redirect(url_for('index')) # 重定向回主页 为了安全的考虑,我们一般会使用 POST 请求来提交删除请求,也就是使用表单来 实现(而不是创建删除链接): index.html:删除电影条目表单 第 7 章:表单 690 码力 | 127 页 | 7.62 MB | 1 年前3
共 3 条
- 1