add device type info to middleware using the same method in context_processors