Python——Flask框架——程序的结构

Posted 澄心元素

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python——Flask框架——程序的结构相关的知识,希望对你有一定的参考价值。

一、项目结构

|-flasky
    |-app  Flask程序一般都保存在这里
        |-templates/
        |-static/
        |main/
            |-__init__.py
            |-errors.py
            |-forms.py
            |-views.py
        |-__init__.py
        |-email.py
        |-models.py
    |-migrations/ 包含数据库迁移的脚本
    |-tests/     单元测试
        |-__init__.py
        |test*.py
    |-venv/   包含Python虚拟环境
    |requirements.txt 列出所有依赖包
    |config.py 存储配置
    |manage.py 用于启动程序

二、config.py程序配置

 

以上是关于Python——Flask框架——程序的结构的主要内容,如果未能解决你的问题,请参考以下文章