make passing a subdomain to reverse() optional
store domain in thread local storage via middleware
2.1.0
changed dict.iteritems() to dict.items() for Python3