Add example code copied from django doc