gpt4 book ai didi

python - 为 MVC 模式组织我的 python 项目,

转载 作者:太空宇宙 更新时间:2023-11-04 06:26:46 24 4
gpt4 key购买 nike

Python 对我来说是新手,我在组织文件代码时遇到了问题。

我想做这样的事情:

./
/views
index.html // Django files

/controlers
main.py

/models
Greeting.py // I take the same classe exemple of Google App Engine Website
/libs
xxx.py //some Lib and tools classes
/static
/js
/css
/images

真正的问题是文件树在 python 环境中是正确的吗?

最佳答案

是的,您的结构有效,或者如果您发现我的示例有用,下面是我如何组织一个较小的应用引擎应用程序:

.
├── app.yaml
├── conf.py
├── main.py
├── model.py
├── static
│   ├── 1.gif
│   ├── 2.gif
│   ├── 3.gif
│   ├── 4.gif
│   ├── anim.gif
│   ├── main.css
│   ├── main.js
└── templates
├── base.html
├── error.html
├── info.html
├── upload.html
├── user.html
└── welcome.html

关于python - 为 MVC 模式组织我的 python 项目,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7427542/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com