All of the code examples I’ve used in the book are available in my repo on GitHub. So, if you ever want to compare your code against mine, you can take a look at it there.
Each chapter has its own branch named after it, like so:
Be aware that each branch contains all of the commits for that chapter, so its state represents the code at the end of the chapter.
https://github.com/hjwp/book-example/tree/chapter_02_unittest
https://github.com/hjwp/book-example/tree/chapter_unit_test_first_view
https://github.com/hjwp/book-example/tree/chapter_philosophy_and_refactoring
https://github.com/hjwp/book-example/tree/chapter_post_and_database
https://github.com/hjwp/book-example/tree/chapter_explicit_waits_1
https://github.com/hjwp/book-example/tree/chapter_working_incrementally
https://github.com/hjwp/book-example/tree/chapter_prettification
https://github.com/hjwp/book-example/tree/chapter_manual_deployment
https://github.com/hjwp/book-example/tree/chapter_making_deployment_production_ready
https://github.com/hjwp/book-example/tree/chapter_automate_deployment_with_fabric
https://github.com/hjwp/book-example/tree/chapter_organising_test_files
https://github.com/hjwp/book-example/tree/chapter_database_layer_validation
https://github.com/hjwp/book-example/tree/chapter_simple_form
https://github.com/hjwp/book-example/tree/chapter_advanced_forms
https://github.com/hjwp/book-example/tree/chapter_javascript
https://github.com/hjwp/book-example/tree/chapter_deploying_validation
https://github.com/hjwp/book-example/tree/chapter_spiking_custom_auth
https://github.com/hjwp/book-example/tree/chapter_fixtures_and_wait_decorator
https://github.com/hjwp/book-example/tree/chapter_server_side_debugging
https://github.com/hjwp/book-example/tree/chapter_outside_in
https://github.com/hjwp/book-example/tree/chapter_purist_unit_tests
https://github.com/hjwp/book-example/tree/chapter_page_pattern
https://github.com/hjwp/book-example/tree/appendix_Django_Class-Based_Views
https://github.com/hjwp/book-example/tree/appendix_DjangoRestFramework
If you feel like developing your Git-Fu a little further, you can add my repo as a remote:
git remote add harry https://github.com/hjwp/book-example.git git fetch harry
And then, to check your difference from the end of Chapter 4:
git diff harry/chapter_philosophy_and_refactoring
Git can handle multiple remotes, so you can still do this even if you’re already pushing your code up to GitHub or Bitbucket.
Be aware that the precise order of, say, methods in a class may differ between your version and mine. It may make diffs hard to read.
If, for whatever reason, you want to “start from scratch” for a chapter, or skip ahead,1 and/or you’re just not comfortable with Git, you can download a version of my code as a ZIP file, from URLs following this pattern:
https://github.com/hjwp/book-example/archive/chapter_01.zip
https://github.com/hjwp/book-example/archive/chapter_philosophy_and_refactoring.zip
Try not to sneak a peek at the answers unless you’re really, really stuck. Like I said at the beginning of the last chapter, there’s a lot of value in debugging errors all by yourself, and in real life, there’s no “harrys repo” to check against and find all the answers.
1 I don’t recommend skipping ahead. I haven’t designed the chapters to stand on their own; each relies on the previous ones, so it may be more confusing than anything else…