fix the django version >= 1.0 and <= 1.5, non tested on 1.6, add ther django import