Reimplement Django's old get_host
Better repr for Python 3 for string types