buy the book ribbon

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.

[chapter_01]

https://github.com/hjwp/book-example/tree/chapter_01

[chapter_02_unittest]

https://github.com/hjwp/book-example/tree/chapter_02_unittest

[chapter_03_unit_test_first_view]

https://github.com/hjwp/book-example/tree/chapter_03_unit_test_first_view

[chapter_04_philosophy_and_refactoring]

https://github.com/hjwp/book-example/tree/chapter_04_philosophy_and_refactoring

[chapter_05_post_and_database]

https://github.com/hjwp/book-example/tree/chapter_05_post_and_database

[chapter_06_explicit_waits_1]

https://github.com/hjwp/book-example/tree/chapter_06_explicit_waits_1

[chapter_07_working_incrementally]

https://github.com/hjwp/book-example/tree/chapter_07_working_incrementally

[chapter_08_prettification]

https://github.com/hjwp/book-example/tree/chapter_08_prettification

[chapter_09_docker]

https://github.com/hjwp/book-example/tree/chapter_09_docker

[chapter_10_production_readiness]

https://github.com/hjwp/book-example/tree/chapter_10_production_readiness

[chapter_11_ansible]

https://github.com/hjwp/book-example/tree/chapter_11_ansible

[chapter_12_organising_test_files]

https://github.com/hjwp/book-example/tree/chapter_12_organising_test_files

[chapter_13_database_layer_validation]

https://github.com/hjwp/book-example/tree/chapter_13_database_layer_validation

[chapter_14_simple_form]

https://github.com/hjwp/book-example/tree/chapter_14_simple_form

[chapter_15_advanced_forms]

https://github.com/hjwp/book-example/tree/chapter_15_advanced_forms

[chapter_16_javascript]

https://github.com/hjwp/book-example/tree/chapter_16_javascript

[chapter_17_second_deploy]

https://github.com/hjwp/book-example/tree/chapter_17_second_deploy

[chapter_18_spiking_custom_auth]

https://github.com/hjwp/book-example/tree/chapter_18_spiking_custom_auth

[chapter_19_mocking]

https://github.com/hjwp/book-example/tree/chapter_19_mocking

[chapter_fixtures_and_wait_decorator]

https://github.com/hjwp/book-example/tree/chapter_fixtures_and_wait_decorator

[chapter_server_side_debugging]

https://github.com/hjwp/book-example/tree/chapter_server_side_debugging

[chapter_outside_in]

https://github.com/hjwp/book-example/tree/chapter_outside_in

[chapter_purist_unit_tests]

https://github.com/hjwp/book-example/tree/chapter_purist_unit_tests

[chapter_CI]

https://github.com/hjwp/book-example/tree/chapter_CI

[chapter_page_pattern]

https://github.com/hjwp/book-example/tree/chapter_page_pattern

[appendix_Django_Class-Based_Views]

https://github.com/hjwp/book-example/tree/appendix_Django_Class-Based_Views

[appendix_bdd]

https://github.com/hjwp/book-example/tree/appendix_bdd

[appendix_rest_api]

https://github.com/hjwp/book-example/tree/appendix_rest_api

[appendix_DjangoRestFramework]

https://github.com/hjwp/book-example/tree/appendix_DjangoRestFramework

Using Git to Check Your Progress

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_04_philosophy_and_refactoring]:

git diff harry/chapter_04_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.

Downloading a ZIP File for a Chapter

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:

Don’t Let it Become a Crutch!

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…​

Comments