My solution

This was a fun problem; I'm rather new to Django so this was good practice - I'd certainly appreciate any feedback!