Update middleware.py

Updated deprecated urls import