Small fixes

 - switched from deprecated django.conf.urls.defaults to django.conf.urls
 - added encoding for middleware before creating md5