Made the django example more robust.