Forward port to new django version