首页 > 其他分享 >flask项目结构参考

flask项目结构参考

时间:2023-08-22 16:11:19浏览次数:28  
标签:used 项目 flask py 参考 application file directory your

project_name/
├── app/
│ ├── models/
│ ├── views/
│ ├── controllers/
│ ├── templates/
│ ├── static/
│ ├── forms/
│ ├── utils/
│ ├── init.py
│ └── config.py
├── instance/
│ └── config.py
├── tests/
├── migrations/
├── requirements.txt
├── run.py
└── README.md

Explanation of each component:

  1. app/: This directory contains the main application code.
  2. models/: This is where you define your SQLAlchemy models or any other data models used in your application.
  3. views/: This directory contains your Flask views or routes.
  4. controllers/: You can create separate modules or packages for your application logic if necessary.
  5. templates/: This is where your HTML templates reside.
  6. static/: This directory can be used to store static files like CSS, JavaScript, and images.
  7. forms/: You can define your WTForms or other form-related code here.
  8. utils/: This directory can contain utility functions, helper classes, or any other reusable code.
  9. init.py: This file initializes the Flask application and any extensions you are using. It also contains the main application factory function.
  10. config.py: This file defines configuration variables for your application.
  11. instance/: This directory contains instance-specific configuration files, such as secret keys or database URLs. It is excluded from version control and should be used for sensitive information.
  12. tests/: This directory is used to store your unit tests.
  13. migrations/: This directory is used for database migrations if you are using a framework like Flask-Migrate.
  14. requirements.txt: This file lists all necessary packages and dependencies for your project. You can generate this file using pip freeze > requirements.txt.
  15. run.py: This file is used to start the development server.
  16. README.md: A markdown file containing documentation and information about your project.
  17. Remember, this is just a suggested structure, and you can customize it based on the specific needs of your project.

标签:used,项目,flask,py,参考,application,file,directory,your
From: https://www.cnblogs.com/feel-myself/p/17648798.html

相关文章

  • 发布项目到 jitpack
    theme:githubhighlight:a11y-dark发布项目到jitpack(Gradle7.x的版本已不适用android-maven的方法发布)1.在要发布androidmodule下的build.grdle添加,多个module就添加多个plugins{id'maven-publish'}tasksourceJar(type:Jar){classifier"sources"fro......
  • 记录一次安卓项目闪退问题
    在最外部声明会导致APP闪退,无法获取上下文中指定的对象 ArrayAdapter<CharSequence>adapterSale=ArrayAdapter.createFromResource(this,R.array.cbxSaleOrderItem,android.R.layout.simple_spinner_item);adapterSale.setDropDownViewResource(......
  • vue-element-admin项目中tagView嵌入iframe不刷新重载
    vue-element-admin项目中tagView嵌入iframe不刷新重载最近使用vue-element-admin来开发项目,因为以前老项目太大,暂不重构,如要通过iframe嵌套在新项目中,通过router来重写url加载,但是业务需要切换菜单或者tagView不能刷新重载iframe页面,因此需要改造一、vue-element-admin是通过......
  • 大屏项目Echarts不同屏幕之间适配
    1.解决方案:使用缩放,前提:需要严格按照设计图提供的像素大小,尽可能少使用百分比以及尽可能少使用rem插件(会导致rem和缩放同时生效反而比例不对),如发现细节不对,需对该处细节精确去按照比例去调整大小,并配合echarts方法解决2.解决方法:2.1给最外层盒子设置缩放样式:.large-scre......
  • 2023北京/西安/深圳CSPM-3国标项目管理中级认证招生
    CSPM-3中级项目管理专业人员评价,是中国标准化协会(全国项目管理标准化技术委员会秘书处),面向社会开展项目管理专业人员能力的等级证书。旨在构建多层次从业人员培养培训体系,建立健全人才职业能力评价和激励机制的要求,培养我国项目管理领域复合型人才。  【证书含金量】 ·竞聘优先......
  • 2023下半年深圳软考信息系统项目管理师认证报名
    信息系统项目管理师是全国计算机技术与软件专业技术资格(水平)考试(简称软考)项目之一,是由国家人力资源和社会保障部、工业和信息化部共同组织的国家级考试,既属于国家职业资格考试,又是职称资格考试。信息系统项目管理师,属于软考三个级别中的“高级”。  【报考要求】 不设学历与资历......
  • 因为celcery项目而抛出的 not enough values to unpack (expected 3, got 0)解决方案
    python=36celery=226django=266在自己刚刚接触celery需要写定时任务的时候,按照大佬写的跑一遍的时候(https://blog.csdn.net/qq_36441027/article/details/123851915),发现自己跑的时候, 就会出现这么诡异的问题。解决办法:pipinstall eventlet 再去cmd里面执行cel......
  • Haxx curl相关漏洞修复参考[CVE-2022-4355]
    Haxxcurl/libcurl安全漏洞修复参考libcurl是一个免费,易用的客户端传输库,支持DICT,FILE,FTP,FTPS,Gopher,HTTP,HTTPS,IMAP,IMAPS,LDAP,LDAPS,POP3,POP3S,RTMP,RTSP,SCP,SFTP,SMTP,SMTPS,TelnetandTFTP等协议。libcurl支持SSL认证,HTTPPOST,HTTPPUT,FTP上......
  • 英语专业学生阅读参考书目
    英语专业学生阅读参考书目   admin        2005-05-27        652 英语专业学生阅读参考书目  一、        英国文学 KingsleyAmis             LuckyJimJaneAusten               P......
  • 项目部署_通过Shell脚本自动部署项目(设置静态ip)
       ......