update middleware to use current django mechanism
Merge pull request #1 from pkatseas/master

update middleware to use current django mechanism