I'm not sure if it counts as a book, but the Django docs are amazing. I learned a lot about web-dev by printing out the docs (500pp at the time) and reading them cover to cover.
I second your praise of Django docs. They're a good example of how technical docs should be written. I think the team behind Django even wrote an article on how to write good docs. My gut feeling is that the docs is part of the reason Djangos is so popular because anyone new to web frameworks would find it easiest to pick up Django.
I believe it totally counts. I learned so much about database relationships from the Django docs.