美文网首页@IT·互联网程序员
《flask Web 开发》读书笔记 & chapter

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

作者: 呆呆的张先生 | 来源:发表于2017-04-26 21:19 被阅读93次

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 dirstructure of app dir

配置类文件

structure of config classstructure of config class

测试文件及其他

information about testsinformation about tests

相关文章

网友评论

    本文标题:《flask Web 开发》读书笔记 & chapter

    本文链接:https://www.haomeiwen.com/subject/ftpwzttx.html