Two Scoops of Django

Daniel Greenfeld, Audrey M. Roy

出版时间

2013-04-16

ISBN

9781481879705

评分

★★★★★
书籍介绍
Two Scoops of Django: Best Practices For Django 1.5 is chock-full of material that will help you with your Django projects. We'll introduce you to various tips, tricks, patterns, code snippets, and techniques that we've picked up over the years. This book is great for: Beginners who have just finished the Django tutorial. Developers with intermediate knowledge of Django who want to improve their Django projects.
AI导读
核心看点
  • 汇集Django最佳实践,涵盖架构设计与代码规范
  • 详解胖模型瘦视图模式,提升代码可维护性
  • 提供配置分离、路径管理等实战技巧与代码片段
适合谁读
  • 刚完成官方教程,希望进阶的Django初学者
  • 具备一定基础,欲优化项目结构的中级开发者
  • 寻求规范化开发流程的Django项目团队
读前提醒
  • 内容偏向经验总结,适合走马观花快速浏览
  • 部分版本较老,需结合当前Django版本甄别
  • 建议配合其他系统教材,构建完整知识体系
读者共识
  • 干货满满,实战经验丰富,值得项目前阅读
  • CBV讲解精彩,模型与模板最佳实践备受推崇
  • 作者文笔流畅,虽碎片化但精华浓缩,好评多

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "Fat Models, Helper Functions, Thin Views, Stupid Templates"
  • "When writing code, it’s important to do so in such a way that it’s easier to move, rename, and version your work. In Python, relative imports remove the need for hardcoding a module’s package, separating individual modules from being tightly coupled to the architecture around them."
  • "Instead of having one settings.py file, with this setup you have a settings/ directory containing your settings files. It will typically contain something like the following: settings/ __init__.py base.py local.py staging.py test.py production.py One of the causes of the local_settings anti-pattern "
  • "We find the the cleanest way to set PROJECT_ROOT is with Unipath (http:// pypi.python.org/pypi/Unipath/), a Python package that does elegant, clean path calculations:  # At the top of settings/base.py from unipath import Path PROJECT_ROOT = Path(__file__).ancestor(3) MEDIA_ROOT = PROJECT"
作者简介
Daniel Greenfeld and Audrey Roy are best known for their open-source community leadership work on the following initiatives: DjangoPackages.com and the OpenComparison framework. We ran the largest sprint at PyCon 2011. PyLadies, a women's outreach/mentorship group. Nurturing the group was basically a 2nd fulltime job for us in 2011. The first ever PyCon Philippines, a 300-person conference about the Python programming language held in the Philippines. The LA Open Source Hackathon event series, which brings together open-source developers from different programming backgrounds. They do Python and Django development and run a small Python/Django consulting shop called Cartwheel Web.
用户评论
实践出真知,这本书值得在开始项目前一看。
Django进阶的一本小书,class-base view和function-base view对比讲的很好,还有model、templates的最佳实践,很棒的一本书!
CBV太赞了
在标准化设计上确实不错...不知道为什么分这么低,表这样啊
常识……
本来想随便读读来复习Django。越读越欲罢不能。Django知识+基础架构+Best Practice,干货满满啊。不管是不是学Django,都值得看一看。
看的最新的1.8版本,依然写的不错~
实战经验大赞
书名很有意思,两勺姜戈。分章讲解了 Django 应用的各种 Best Practices。上次接触 Django 的时候是1.3,那时好像还没有 CBV,这本书比较适合有 Django 基础的人阅读,基于 Python 自身的可读性,我读的很快基本上走马观花,有了个大概的了解,再找本其他的书读一读吧,Pro Django 看上去不赖。
收藏