flask-tutorial icon indicating copy to clipboard operation
flask-tutorial copied to clipboard

Flask 入门教程 / Flask for Beginners

Results 9 flask-tutorial issues
Sort by recently updated
recently updated
newest added

- Remove `FLASK_ENV` - Introduce `--app` and `--debug` options

尝试使用下面的工具生成 PDF 文件: - https://github.com/fuergaosi233/gitbook2pdf - https://github.com/orzih/mkdocs-with-pdf

## 使用命令:flask shell 出现如下图报错: ![image](https://github.com/helloflask/flask-tutorial/assets/115458503/0cc1e8dc-41c7-44df-a383-ec8877078e34) ## 网上查阅的资料: `地址`:https://stackoverflow.com/questions/73340344/cannot-use-module-aioflaskpython-importerror-cannot-import-name-app-ctx-st ![image](https://github.com/helloflask/flask-tutorial/assets/115458503/708a4f59-aecd-47d6-a077-1d29fe3d1c55) ## 困惑 次教程是flask3.0X版本,是需要降低flask版本吗?

章节:第9章 位置:test_watchlist.py:测试认证相关功能 ``` class WatchlistTestCase(unittest.TestCase): # ... # 测试登录保护 def test_login_protect(self): response = self.client.get('/') data = response.get_data(as_text=True) self.assertNotIn('Logout', data) ...... ``` 这个测试用例不会通过,原因猜测可能是存在登录的缓存,我看了返回的html是登录过后的。于是我在前面加了个logout的方法,并且在这段代码前使用,即可通过测试: ``` def logout(self): self.client.get('/logout') ...... def test_login_protect(self): self.logout()...

- Consider introducing app factory to make testing easier. - Remove the pinned version in #27

“目前它在 GitHub 上是 Star 数量最多的 Python Web 框架,没有之一” 大约在2021年被超了 😂 https://star-history.com/#django/django&pallets/flask&Date