Pro Django 书还有用吗?

发布于 2024-12-09 19:23:17 字数 225 浏览 2 评论 0原文

我想更深入地了解 Django 的内部结构,而官方在线文档仅能达到此目的。

Marty Alchin 的 Pro Django 的评论非常棒(我读过 Pro Python 并且非常喜欢它)。然而,这本书是 2008 年的,基于 Django v1.0。我的公司基于 v1.3 构建。

这本书还有价值吗?我怎样才能最好地了解 Django 的元编程(除了查看源代码,我也在这样做)?

谢谢

I want to dig deeper into Django's internals and the official online documentation only goes so far toward that end.

The reviews for Marty Alchin's Pro Django are fantastic (I've read Pro Python and really enjoyed it). However, the book is from 2008 and is based on Django v1.0. My company builds off v1.3.

Is this book still worthwhile? How can I best learn about Django's meta-programming (beyond looking through the source code, which I am also doing)?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温柔戏命师 2024-12-16 19:23:17

我不该谈论它的价值或建议,但我在写这本书时就考虑到了 Django 1.0,以确保它尽可能长时间地保持相关性。我记录的 Django 方面仍然存在且功能正常,Python 的一般方面也仍然有效。它们可能一路上增加了额外的选项,但它们不应该很快被删除或以任何向后不兼容的方式进行更改。

也就是说,我介绍了一些最佳实践的示例,以及 Django 当时不支持的一些解决方法。由于自 1.0 发布以来 Django 添加了新功能,这些不一定仍然是最好的方法。因此,请随意阅读它以了解其工作原理的事实描述,但请对这些建议持保留态度,并始终查阅官方文档以了解最新功能。

It's not my place to speak about its worth or recommendations, but I wrote the book with Django 1.0 in mind precisely to make sure it stayed relevant as long as possible. The aspects of Django that I documented are still present and functional, and the general aspects of Python are also still valid. They may have grown additional options along the way, but they shouldn't be removed any time soon or changed in any backward-incompatible way.

That said, I covered some examples of best practices and also some workarounds for things that Django didn't support at the time. Because of new features added to Django since 1.0 was released, these aren't necessarily still the best approaches anymore. So feel free to read it for the factual descriptions of how things work, but take the recommendations with a grain of salt and always consult the official documentation for the latest features.

葬花如无物 2024-12-16 19:23:17

是的,它绝对仍然相关。尽管自版本 1 以来 Django 发生了很多变化,但 Pro Django 处理的内部部分和概念大部分是相同的。我会毫不犹豫地推荐这本书——它对 Django 的工作原理有非常有用的见解,并且还教授了一些非常有用的方法。

Yes, it's definitely still relevant. Although a lot has changed in Django since version 1, the internal parts and the concepts that Pro Django deals with are mostly the same. I'd have no hesitation in recommending the book - it's a really useful insight into how Django works and teaches some very useful methods as well.

ゞ花落谁相伴 2024-12-16 19:23:17

一般来说,任何 Django 1.* 都仍然相关。从 1.0 到 1.3 的变化并不那么显着,因此版本编号(点发布而不是里程碑)。不过,任何 1.0 之前编写的内容都可以被烧毁。

1.3 最大的变化是基于类的视图。尽管仍然支持旧式的基于方法的视图(并且可能会无限期地继续支持),但您应该尝试使用基于类的视图。请参阅: https://docs.djangoproject.com/en/dev/ topic/class-based-views/

除此之外,我建议在 Django 文档中快速查找,因为 Pro Django 书中讨论了功能。您可以将文档定位到 1.3 版本,如果发生更改,它会通知更改的时间和地点。

Generally, anything that is Django 1.* remains relevant. The changes from 1.0 to 1.3 aren't that dramatic, hence the version numbering (point-releases instead of milestones). Anything written pre-1.0 can be burned, though.

The biggest 1.3 change is class-based views. Although old-style method-based views are still supported (and likely will continue to be indefinitely), you should try to use class-based views instead. See: https://docs.djangoproject.com/en/dev/topics/class-based-views/

Other than that, I'd recommend simply doing a quick lookup in the Django docs as features are discussed in the Pro Django book. You can target the docs to the 1.3 release, and it'll notify when and where things changed, if they've changed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文