《flask Web 开发》读书笔记 & chapter7

chapter 2 - chapter 3 - chapter 4 - chapter 5 - chapter 6 - 源码

概念剖析-flask大型程序的结构

推荐项目结构模板

|-flasky                                # Flask 程序一般保存在 app 的包中
  |-app/
    |-templates/
    |-static/
    |-main/
      |-__init__.py
      |-errors.py
      |-forms.py
      |-views.py
    |-__init__.py
    |-email.py
    |-models.py
  |-migrations                          # Flask 包含数据库迁移脚本
  |-tests/                              # test包 包含单元测试
    |-__init__.py
    |-test*.py
  |venv/                                # 包含 Python 虚拟环境
  |-requirements.txt                     # requirements.txt 列出所有的依赖包,便于在其他电脑上生成相同的环境设置
  |-config.py                            # config.py 存储配置
  |-manage.py                            # 用于启动程序以及其他的程序任务

app程序目录的结构

structure of app dir
structure of app dir

配置类文件

structure of config class
structure of config class

测试文件及其他

information about tests
information about tests
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容