use force_bytes to encode before hashing
list expected
Update middleware.py

from __future__ import unicode_literals