James CookeJames Cooke

Fixing exception in django-menu

django-menu is a nice simple library for building very simple menus. However, when a site is loaded for the first time, the menu structure was not configured and so it was throwing a DoesNotExist Exception.

This tiny pull request simply wrapped the call to the menu in a try/except so that new sites using django-menu won’t fall over on first load.


  • Comparing Django Q Objects

    A super simple assertion helper for comparing instances of Django’s Q objects.

  • Django’s model save vs full_clean

    Confirming that Django can screw up your data when saving, and exploring why this is still the case.

  • Django Factory Audit

    Exploring the various model instance factories available for Django. Each factory is tested based on the quality of the instances it creates. Bonus: talk version and slides also available.