当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Is Pro Django book still relevant?

问题描述:

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

网友答案:

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.

网友答案:

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.

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: