3

python进阶学习之django框架

 1 year ago
source link: https://blog.shareworld.vip/archives/django1
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

python进阶学习之django框架

Owen Jia 2023年03月05日 2次浏览

回归学习python的初衷,有三个目标,如下。

  • 作为常用的脚本开发语言,用来处理临时性的需求
  • 作为桌面软件开发语言,用来开发小程序提供给用户使用
  • 作为web系统的开发语言,调研主流web开发框架

本篇就是第三个目标的调研结果分享,前两个以及完成。

python web开发框架django目前引用很广泛,也十分的成熟,首先对它的调研学习。把官网的Tutorial的用例全套学习下来,各种用例手动写并运行、分析。搞了不少天,收获非常大,对django开发web系统的project有了全局了解,包括路由、页面、静态资源、数据库、持久化、sql、接口等等。

up-559b164a86531a4466af9848fc4b3ebcdae.png

up-4d3cf29a0a3acd8f6f80ed5bcc8482616df.png

up-45a8793d36e52035f0eb53b8736301f3051.png

up-b60ff0872b5612682eae494961a993b9df2.png

对django框架的使用,总结来说分以下节点。

  • 页面通过模板方式实现,和freemarker\themeleaf\jsp很像,也包括php
  • 框架很全,涵盖了web系统需要的各个方面,特别像路由等
  • UI在框架内已经模块化、组件化,可直接使用
  • 和vue、react前端开发语言有很多区别

感受下来,django和freemarker之类属于同一模式的,比这些框架要全面而强大。但是,非主要前端开发语言,有学习成本,适用性属于小众市场,大型web系统没见过用它的,并且真正用起来怕是会非常难受。

我的样例代码地址:https://github.com/owen-jia/empty-py-demo

up-4da736ee2249fe4630488549df2460e0213.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK