如何在Flask中创建类似于Codeigniter

时间:2017-11-02 03:45:56

标签: python flask

我是一名PHP(Codeigniter)开发人员,需要使用Python来开发新项目。我决定在Google App Engine上使用Flask。但是我对如何创建像Codeigniter中的模型和控制器感到困惑。

有人可以指导我如何解决这个问题吗?

P.S。我是Python和Flask的新手

1 个答案:

答案 0 :(得分:4)

您的项目文件夹结构如下所示:

file structure

或者这个:

project\
    run.py
    config.py
    app\
        __init__.py
        views.py
        models.py
        controllers.py
        templates\
            index.html
            about.html
            layout.html
        static\
            css\
                main.css
            js\
                main.js

如果您需要更多信息,可以查看此structure for big applicationsfor virtual environments