I tried this: but it doesn't work.
print urllib.urlencode("http://"+SITE_DOMAIN+"/go/")
I want to turn it into a string with url encodings
Were you looking for the quote() or quote_plus() function instead?
>>> urllib.quote("http://spam.com/go/")
'http%3A%2F%2Fspam.com%2Fgo%2F'
quote_plus() is probably the one you'll really be using the most.quote in Python2 treats "/" as safe and doesn't encode them.
urlencode()is for converting a sequence (eq tuple) or mapping (eq dict) object to a querystring. For future reference, the Python docs are a really good resource to use: docs.python.org/library/index.html