Created
August 21, 2009 15:34
-
-
Save whilefalse/172111 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def current_host(request): | |
url = 'http://%s' % request.META['SERVER_NAME'] | |
if request.META['SERVER_PORT'] != 80: | |
url = url + ':%s' % request.META['SERVER_PORT'] | |
return url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment