Log all exceptions

Uses a middleware to capture exceptions and log them.  This is useful
for serving images and ajax calls, where the text of 500 errors
are not displayed.
Merge branch 'master' into log_all_exceptions
Fixed whitespace.
Move middleware setting, improve exception message.
Removed unused import
Merge pull request #954 from andrewbaxter/log_all_exceptions

Log all exceptions
Run the tests on Django 1.7
Merge pull request #956 from brutasse/feature/django17

Run the tests on Django 1.7