handle If-Modified-Since and Last-Modified, fixes bug 1820
fix new import path in recent Django versions
remove unused imports
remove unused django.contrib.messages