Fix configure to work with Django <1.7 and >=1.7