'Return the approved Document the URL represents, None if there isn\'t one.
Taken from:
https://github.com/mozilla/kitsune/blob/dd944c9ebb126cc1e660fba569cd68a6c7e88430/kitsune/wiki/models.py#L388
Return None if the URL is a 404, the URL doesn\'t point to the right
view, or the indicated document doesn\'t exist.
To fetch all values of the returned Document not only ID,
set `id_only` to True.'

@classmethod
def from_url(cls, url, id_only=True):

    try:
        components = get_doc_components_from_url(url)
    except NotDocumentView:
        return None
    if (not components):
        return None
    (locale, path, slug) = components
    doc = cls.objects
    if id_only:
        doc = doc.only('id')
    try:
        doc = doc.get(locale=locale, slug=slug)
    except cls.DoesNotExist:
        try:
            doc = doc.get(locale=settings.WIKI_DEFAULT_LANGUAGE, slug=slug)
            translation = doc.translated_to(locale)
            if translation:
                return translation
        except cls.DoesNotExist:
            return None
    return doc
