路径: /common/lib/xmodule/xmodule/util/django.py
代码:
from crum import get_current_requestdef get_current_request_hostname(): """ This method will return the hostname that was used in the current Django request """ hostname = None request = get_current_request() if request: hostname = request.META.get('HTTP_HOST') return hostname