Getting Protocol and Host Name from URLs in Django
Django provides useful utilities for working with URLs in your Python code. Two particularly handy methods allow you to extract just the protocol (http vs https) or the host name from a full URL string. In this post, we’ll explore these functions and see examples of how to use urlsplit and get_host to get these … Read more