We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Open Graph og:url tags over-canonicalize all URLs back to the home page
Split from #12187:

> By the way, it turns out all our OpenGraph tags are [busted anyway](https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fchat.zulip.org%2Fapi%2Fincoming-webhooks-walkthrough) because we always set `og:url` to point to the home page (which redirects to /login, whose `og:url` points back to the home page).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `zerver/context_processors.py`
Content:
```
1 
2 from typing import Any, Dict
3 from django.http import HttpRequest
4 from django.conf import settings
5 from django.urls import reverse
6 
7 from zerver.models import UserProfile, get_realm, Realm
8 from zproject.backends import (
9     any_oauth_backend_enabled,
10     password_auth_enabled,
11     require_email_format_usernames,
12     auth_enabled_helper,
13     AUTH_BACKEND_NAME_MAP,
14     SOCIAL_AUTH_BACKENDS,
15 )
16 from zerver.decorator import get_client_name
17 from zerver.lib.send_email import FromAddress
18 from zerver.lib.subdomains import get_subdomain
19 from zerver.lib.realm_icon import get_realm_icon_url
20 from zerver.lib.realm_description import get_realm_rendered_description, get_realm_text_description
21 
22 from version import ZULIP_VERSION, LATEST_RELEASE_VERSION, LATEST_MAJOR_VERSION, \
23     LATEST_RELEASE_ANNOUNCEMENT
24 
25 def common_context(user: UserProfile) -> Dict[str, Any]:
26     """Common context used for things like outgoing emails that don't
27     have a request.
28     """
29     return {
30         'realm_uri': user.realm.uri,
31         'realm_name': user.realm.name,
32         'root_domain_uri': settings.ROOT_DOMAIN_URI,
33         'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,
34         'external_host': settings.EXTERNAL_HOST,
35         'user_name': user.full_name,
36     }
37 
38 def get_realm_from_request(request: HttpRequest) -> Realm:
39     if hasattr(request, "user") and hasattr(request.user, "realm"):
40         return request.user.realm
41     if not hasattr(request, "realm"):
42         # We cache the realm object from this function on the request,
43         # so that functions that call get_realm_from_request don't
44         # need to do duplicate queries on the same realm while
45         # processing a single request.
46         subdomain = get_subdomain(request)
47         request.realm = get_realm(subdomain)
48     return request.realm
49 
50 def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
51     """Context available to all Zulip Jinja2 templates that have a request
52     passed in.  Designed to provide the long list of variables at the
53     bottom of this function in a wide range of situations: logged-in
54     or logged-out, subdomains or not, etc.
55 
56     The main variable in the below is whether we know what realm the
57     user is trying to interact with.
58     """
59     realm = get_realm_from_request(request)
60 
61     if realm is None:
62         realm_uri = settings.ROOT_DOMAIN_URI
63         realm_name = None
64         realm_icon = None
65     else:
66         realm_uri = realm.uri
67         realm_name = realm.name
68         realm_icon = get_realm_icon_url(realm)
69 
70     register_link_disabled = settings.REGISTER_LINK_DISABLED
71     login_link_disabled = settings.LOGIN_LINK_DISABLED
72     find_team_link_disabled = settings.FIND_TEAM_LINK_DISABLED
73     allow_search_engine_indexing = False
74 
75     if (settings.ROOT_DOMAIN_LANDING_PAGE
76             and get_subdomain(request) == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN):
77         register_link_disabled = True
78         login_link_disabled = True
79         find_team_link_disabled = False
80         allow_search_engine_indexing = True
81 
82     apps_page_url = 'https://zulipchat.com/apps/'
83     if settings.ZILENCER_ENABLED:
84         apps_page_url = '/apps/'
85 
86     user_is_authenticated = False
87     if hasattr(request, 'user') and hasattr(request.user, 'is_authenticated'):
88         user_is_authenticated = request.user.is_authenticated.value
89 
90     if settings.DEVELOPMENT:
91         secrets_path = "zproject/dev-secrets.conf"
92         settings_path = "zproject/dev_settings.py"
93         settings_comments_path = "zproject/prod_settings_template.py"
94     else:
95         secrets_path = "/etc/zulip/zulip-secrets.conf"
96         settings_path = "/etc/zulip/settings.py"
97         settings_comments_path = "/etc/zulip/settings.py"
98 
99     # We can't use request.client here because we might not be using
100     # an auth decorator that sets it, but we can call its helper to
101     # get the same result.
102     platform = get_client_name(request, True)
103 
104     context = {
105         'root_domain_landing_page': settings.ROOT_DOMAIN_LANDING_PAGE,
106         'custom_logo_url': settings.CUSTOM_LOGO_URL,
107         'register_link_disabled': register_link_disabled,
108         'login_link_disabled': login_link_disabled,
109         'terms_of_service': settings.TERMS_OF_SERVICE,
110         'privacy_policy': settings.PRIVACY_POLICY,
111         'login_url': settings.HOME_NOT_LOGGED_IN,
112         'only_sso': settings.ONLY_SSO,
113         'external_host': settings.EXTERNAL_HOST,
114         'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,
115         'realm_uri': realm_uri,
116         'realm_name': realm_name,
117         'realm_icon': realm_icon,
118         'root_domain_uri': settings.ROOT_DOMAIN_URI,
119         'apps_page_url': apps_page_url,
120         'open_realm_creation': settings.OPEN_REALM_CREATION,
121         'development_environment': settings.DEVELOPMENT,
122         'support_email': FromAddress.SUPPORT,
123         'find_team_link_disabled': find_team_link_disabled,
124         'password_min_length': settings.PASSWORD_MIN_LENGTH,
125         'password_min_guesses': settings.PASSWORD_MIN_GUESSES,
126         'jitsi_server_url': settings.JITSI_SERVER_URL,
127         'zulip_version': ZULIP_VERSION,
128         'user_is_authenticated': user_is_authenticated,
129         'settings_path': settings_path,
130         'secrets_path': secrets_path,
131         'settings_comments_path': settings_comments_path,
132         'platform': platform,
133         'allow_search_engine_indexing': allow_search_engine_indexing,
134     }
135 
136     if realm is not None and realm.icon_source == realm.ICON_UPLOADED:
137         context['OPEN_GRAPH_IMAGE'] = '%s%s' % (realm_uri, realm_icon)
138 
139     return context
140 
141 def login_context(request: HttpRequest) -> Dict[str, Any]:
142     realm = get_realm_from_request(request)
143 
144     if realm is None:
145         realm_description = None
146         realm_invite_required = False
147     else:
148         realm_description = get_realm_rendered_description(realm)
149         realm_invite_required = realm.invite_required
150 
151     context = {
152         'realm_invite_required': realm_invite_required,
153         'realm_description': realm_description,
154         'require_email_format_usernames': require_email_format_usernames(realm),
155         'password_auth_enabled': password_auth_enabled(realm),
156         'any_oauth_backend_enabled': any_oauth_backend_enabled(realm),
157         'two_factor_authentication_enabled': settings.TWO_FACTOR_AUTHENTICATION_ENABLED,
158     }  # type: Dict[str, Any]
159 
160     if realm is not None and realm.description:
161         context['OPEN_GRAPH_TITLE'] = realm.name
162         context['OPEN_GRAPH_DESCRIPTION'] = get_realm_text_description(realm)
163 
164     # Add the keys for our standard authentication backends.
165     no_auth_enabled = True
166     social_backends = []
167     for auth_backend_name in AUTH_BACKEND_NAME_MAP:
168         name_lower = auth_backend_name.lower()
169         key = "%s_auth_enabled" % (name_lower,)
170         is_enabled = auth_enabled_helper([auth_backend_name], realm)
171         context[key] = is_enabled
172         if is_enabled:
173             no_auth_enabled = False
174 
175         # Now add the enabled social backends to the social_backends
176         # list used to generate buttons for login/register pages.
177         backend = AUTH_BACKEND_NAME_MAP[auth_backend_name]
178         if not is_enabled or backend not in SOCIAL_AUTH_BACKENDS:
179             continue
180         social_backends.append({
181             'name': backend.name,
182             'display_name': backend.auth_backend_name,
183             'login_url': reverse('login-social', args=(backend.name,)),
184             'signup_url': reverse('signup-social', args=(backend.name,)),
185             'sort_order': backend.sort_order,
186         })
187     context['social_backends'] = sorted(social_backends, key=lambda x: x['sort_order'], reverse=True)
188     context['no_auth_enabled'] = no_auth_enabled
189 
190     return context
191 
192 def latest_info_context() -> Dict[str, str]:
193     context = {
194         'latest_release_version': LATEST_RELEASE_VERSION,
195         'latest_major_version': LATEST_MAJOR_VERSION,
196         'latest_release_announcement': LATEST_RELEASE_ANNOUNCEMENT,
197     }
198     return context
199
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/zerver/context_processors.py b/zerver/context_processors.py
--- a/zerver/context_processors.py
+++ b/zerver/context_processors.py
@@ -133,6 +133,7 @@
         'allow_search_engine_indexing': allow_search_engine_indexing,
     }
 
+    context['OPEN_GRAPH_URL'] = '%s%s' % (realm_uri, request.path)
     if realm is not None and realm.icon_source == realm.ICON_UPLOADED:
         context['OPEN_GRAPH_IMAGE'] = '%s%s' % (realm_uri, realm_icon)

{"golden_diff": "diff --git a/zerver/context_processors.py b/zerver/context_processors.py\n--- a/zerver/context_processors.py\n+++ b/zerver/context_processors.py\n@@ -133,6 +133,7 @@\n         'allow_search_engine_indexing': allow_search_engine_indexing,\n     }\n \n+    context['OPEN_GRAPH_URL'] = '%s%s' % (realm_uri, request.path)\n     if realm is not None and realm.icon_source == realm.ICON_UPLOADED:\n         context['OPEN_GRAPH_IMAGE'] = '%s%s' % (realm_uri, realm_icon)\n", "issue": "Open Graph og:url tags over-canonicalize all URLs back to the home page\nSplit from #12187:\r\n\r\n> By the way, it turns out all our OpenGraph tags are [busted anyway](https://developers.facebook.com/tools/debug/sharing/?q=https%3A%2F%2Fchat.zulip.org%2Fapi%2Fincoming-webhooks-walkthrough) because we always set `og:url` to point to the home page (which redirects to /login, whose `og:url` points back to the home page).\n", "before_files": [{"content": "\nfrom typing import Any, Dict\nfrom django.http import HttpRequest\nfrom django.conf import settings\nfrom django.urls import reverse\n\nfrom zerver.models import UserProfile, get_realm, Realm\nfrom zproject.backends import (\n    any_oauth_backend_enabled,\n    password_auth_enabled,\n    require_email_format_usernames,\n    auth_enabled_helper,\n    AUTH_BACKEND_NAME_MAP,\n    SOCIAL_AUTH_BACKENDS,\n)\nfrom zerver.decorator import get_client_name\nfrom zerver.lib.send_email import FromAddress\nfrom zerver.lib.subdomains import get_subdomain\nfrom zerver.lib.realm_icon import get_realm_icon_url\nfrom zerver.lib.realm_description import get_realm_rendered_description, get_realm_text_description\n\nfrom version import ZULIP_VERSION, LATEST_RELEASE_VERSION, LATEST_MAJOR_VERSION, \\\n    LATEST_RELEASE_ANNOUNCEMENT\n\ndef common_context(user: UserProfile) -> Dict[str, Any]:\n    \"\"\"Common context used for things like outgoing emails that don't\n    have a request.\n    \"\"\"\n    return {\n        'realm_uri': user.realm.uri,\n        'realm_name': user.realm.name,\n        'root_domain_uri': settings.ROOT_DOMAIN_URI,\n        'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,\n        'external_host': settings.EXTERNAL_HOST,\n        'user_name': user.full_name,\n    }\n\ndef get_realm_from_request(request: HttpRequest) -> Realm:\n    if hasattr(request, \"user\") and hasattr(request.user, \"realm\"):\n        return request.user.realm\n    if not hasattr(request, \"realm\"):\n        # We cache the realm object from this function on the request,\n        # so that functions that call get_realm_from_request don't\n        # need to do duplicate queries on the same realm while\n        # processing a single request.\n        subdomain = get_subdomain(request)\n        request.realm = get_realm(subdomain)\n    return request.realm\n\ndef zulip_default_context(request: HttpRequest) -> Dict[str, Any]:\n    \"\"\"Context available to all Zulip Jinja2 templates that have a request\n    passed in.  Designed to provide the long list of variables at the\n    bottom of this function in a wide range of situations: logged-in\n    or logged-out, subdomains or not, etc.\n\n    The main variable in the below is whether we know what realm the\n    user is trying to interact with.\n    \"\"\"\n    realm = get_realm_from_request(request)\n\n    if realm is None:\n        realm_uri = settings.ROOT_DOMAIN_URI\n        realm_name = None\n        realm_icon = None\n    else:\n        realm_uri = realm.uri\n        realm_name = realm.name\n        realm_icon = get_realm_icon_url(realm)\n\n    register_link_disabled = settings.REGISTER_LINK_DISABLED\n    login_link_disabled = settings.LOGIN_LINK_DISABLED\n    find_team_link_disabled = settings.FIND_TEAM_LINK_DISABLED\n    allow_search_engine_indexing = False\n\n    if (settings.ROOT_DOMAIN_LANDING_PAGE\n            and get_subdomain(request) == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN):\n        register_link_disabled = True\n        login_link_disabled = True\n        find_team_link_disabled = False\n        allow_search_engine_indexing = True\n\n    apps_page_url = 'https://zulipchat.com/apps/'\n    if settings.ZILENCER_ENABLED:\n        apps_page_url = '/apps/'\n\n    user_is_authenticated = False\n    if hasattr(request, 'user') and hasattr(request.user, 'is_authenticated'):\n        user_is_authenticated = request.user.is_authenticated.value\n\n    if settings.DEVELOPMENT:\n        secrets_path = \"zproject/dev-secrets.conf\"\n        settings_path = \"zproject/dev_settings.py\"\n        settings_comments_path = \"zproject/prod_settings_template.py\"\n    else:\n        secrets_path = \"/etc/zulip/zulip-secrets.conf\"\n        settings_path = \"/etc/zulip/settings.py\"\n        settings_comments_path = \"/etc/zulip/settings.py\"\n\n    # We can't use request.client here because we might not be using\n    # an auth decorator that sets it, but we can call its helper to\n    # get the same result.\n    platform = get_client_name(request, True)\n\n    context = {\n        'root_domain_landing_page': settings.ROOT_DOMAIN_LANDING_PAGE,\n        'custom_logo_url': settings.CUSTOM_LOGO_URL,\n        'register_link_disabled': register_link_disabled,\n        'login_link_disabled': login_link_disabled,\n        'terms_of_service': settings.TERMS_OF_SERVICE,\n        'privacy_policy': settings.PRIVACY_POLICY,\n        'login_url': settings.HOME_NOT_LOGGED_IN,\n        'only_sso': settings.ONLY_SSO,\n        'external_host': settings.EXTERNAL_HOST,\n        'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,\n        'realm_uri': realm_uri,\n        'realm_name': realm_name,\n        'realm_icon': realm_icon,\n        'root_domain_uri': settings.ROOT_DOMAIN_URI,\n        'apps_page_url': apps_page_url,\n        'open_realm_creation': settings.OPEN_REALM_CREATION,\n        'development_environment': settings.DEVELOPMENT,\n        'support_email': FromAddress.SUPPORT,\n        'find_team_link_disabled': find_team_link_disabled,\n        'password_min_length': settings.PASSWORD_MIN_LENGTH,\n        'password_min_guesses': settings.PASSWORD_MIN_GUESSES,\n        'jitsi_server_url': settings.JITSI_SERVER_URL,\n        'zulip_version': ZULIP_VERSION,\n        'user_is_authenticated': user_is_authenticated,\n        'settings_path': settings_path,\n        'secrets_path': secrets_path,\n        'settings_comments_path': settings_comments_path,\n        'platform': platform,\n        'allow_search_engine_indexing': allow_search_engine_indexing,\n    }\n\n    if realm is not None and realm.icon_source == realm.ICON_UPLOADED:\n        context['OPEN_GRAPH_IMAGE'] = '%s%s' % (realm_uri, realm_icon)\n\n    return context\n\ndef login_context(request: HttpRequest) -> Dict[str, Any]:\n    realm = get_realm_from_request(request)\n\n    if realm is None:\n        realm_description = None\n        realm_invite_required = False\n    else:\n        realm_description = get_realm_rendered_description(realm)\n        realm_invite_required = realm.invite_required\n\n    context = {\n        'realm_invite_required': realm_invite_required,\n        'realm_description': realm_description,\n        'require_email_format_usernames': require_email_format_usernames(realm),\n        'password_auth_enabled': password_auth_enabled(realm),\n        'any_oauth_backend_enabled': any_oauth_backend_enabled(realm),\n        'two_factor_authentication_enabled': settings.TWO_FACTOR_AUTHENTICATION_ENABLED,\n    }  # type: Dict[str, Any]\n\n    if realm is not None and realm.description:\n        context['OPEN_GRAPH_TITLE'] = realm.name\n        context['OPEN_GRAPH_DESCRIPTION'] = get_realm_text_description(realm)\n\n    # Add the keys for our standard authentication backends.\n    no_auth_enabled = True\n    social_backends = []\n    for auth_backend_name in AUTH_BACKEND_NAME_MAP:\n        name_lower = auth_backend_name.lower()\n        key = \"%s_auth_enabled\" % (name_lower,)\n        is_enabled = auth_enabled_helper([auth_backend_name], realm)\n        context[key] = is_enabled\n        if is_enabled:\n            no_auth_enabled = False\n\n        # Now add the enabled social backends to the social_backends\n        # list used to generate buttons for login/register pages.\n        backend = AUTH_BACKEND_NAME_MAP[auth_backend_name]\n        if not is_enabled or backend not in SOCIAL_AUTH_BACKENDS:\n            continue\n        social_backends.append({\n            'name': backend.name,\n            'display_name': backend.auth_backend_name,\n            'login_url': reverse('login-social', args=(backend.name,)),\n            'signup_url': reverse('signup-social', args=(backend.name,)),\n            'sort_order': backend.sort_order,\n        })\n    context['social_backends'] = sorted(social_backends, key=lambda x: x['sort_order'], reverse=True)\n    context['no_auth_enabled'] = no_auth_enabled\n\n    return context\n\ndef latest_info_context() -> Dict[str, str]:\n    context = {\n        'latest_release_version': LATEST_RELEASE_VERSION,\n        'latest_major_version': LATEST_MAJOR_VERSION,\n        'latest_release_announcement': LATEST_RELEASE_ANNOUNCEMENT,\n    }\n    return context\n", "path": "zerver/context_processors.py"}], "after_files": [{"content": "\nfrom typing import Any, Dict\nfrom django.http import HttpRequest\nfrom django.conf import settings\nfrom django.urls import reverse\n\nfrom zerver.models import UserProfile, get_realm, Realm\nfrom zproject.backends import (\n    any_oauth_backend_enabled,\n    password_auth_enabled,\n    require_email_format_usernames,\n    auth_enabled_helper,\n    AUTH_BACKEND_NAME_MAP,\n    SOCIAL_AUTH_BACKENDS,\n)\nfrom zerver.decorator import get_client_name\nfrom zerver.lib.send_email import FromAddress\nfrom zerver.lib.subdomains import get_subdomain\nfrom zerver.lib.realm_icon import get_realm_icon_url\nfrom zerver.lib.realm_description import get_realm_rendered_description, get_realm_text_description\n\nfrom version import ZULIP_VERSION, LATEST_RELEASE_VERSION, LATEST_MAJOR_VERSION, \\\n    LATEST_RELEASE_ANNOUNCEMENT\n\ndef common_context(user: UserProfile) -> Dict[str, Any]:\n    \"\"\"Common context used for things like outgoing emails that don't\n    have a request.\n    \"\"\"\n    return {\n        'realm_uri': user.realm.uri,\n        'realm_name': user.realm.name,\n        'root_domain_uri': settings.ROOT_DOMAIN_URI,\n        'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,\n        'external_host': settings.EXTERNAL_HOST,\n        'user_name': user.full_name,\n    }\n\ndef get_realm_from_request(request: HttpRequest) -> Realm:\n    if hasattr(request, \"user\") and hasattr(request.user, \"realm\"):\n        return request.user.realm\n    if not hasattr(request, \"realm\"):\n        # We cache the realm object from this function on the request,\n        # so that functions that call get_realm_from_request don't\n        # need to do duplicate queries on the same realm while\n        # processing a single request.\n        subdomain = get_subdomain(request)\n        request.realm = get_realm(subdomain)\n    return request.realm\n\ndef zulip_default_context(request: HttpRequest) -> Dict[str, Any]:\n    \"\"\"Context available to all Zulip Jinja2 templates that have a request\n    passed in.  Designed to provide the long list of variables at the\n    bottom of this function in a wide range of situations: logged-in\n    or logged-out, subdomains or not, etc.\n\n    The main variable in the below is whether we know what realm the\n    user is trying to interact with.\n    \"\"\"\n    realm = get_realm_from_request(request)\n\n    if realm is None:\n        realm_uri = settings.ROOT_DOMAIN_URI\n        realm_name = None\n        realm_icon = None\n    else:\n        realm_uri = realm.uri\n        realm_name = realm.name\n        realm_icon = get_realm_icon_url(realm)\n\n    register_link_disabled = settings.REGISTER_LINK_DISABLED\n    login_link_disabled = settings.LOGIN_LINK_DISABLED\n    find_team_link_disabled = settings.FIND_TEAM_LINK_DISABLED\n    allow_search_engine_indexing = False\n\n    if (settings.ROOT_DOMAIN_LANDING_PAGE\n            and get_subdomain(request) == Realm.SUBDOMAIN_FOR_ROOT_DOMAIN):\n        register_link_disabled = True\n        login_link_disabled = True\n        find_team_link_disabled = False\n        allow_search_engine_indexing = True\n\n    apps_page_url = 'https://zulipchat.com/apps/'\n    if settings.ZILENCER_ENABLED:\n        apps_page_url = '/apps/'\n\n    user_is_authenticated = False\n    if hasattr(request, 'user') and hasattr(request.user, 'is_authenticated'):\n        user_is_authenticated = request.user.is_authenticated.value\n\n    if settings.DEVELOPMENT:\n        secrets_path = \"zproject/dev-secrets.conf\"\n        settings_path = \"zproject/dev_settings.py\"\n        settings_comments_path = \"zproject/prod_settings_template.py\"\n    else:\n        secrets_path = \"/etc/zulip/zulip-secrets.conf\"\n        settings_path = \"/etc/zulip/settings.py\"\n        settings_comments_path = \"/etc/zulip/settings.py\"\n\n    # We can't use request.client here because we might not be using\n    # an auth decorator that sets it, but we can call its helper to\n    # get the same result.\n    platform = get_client_name(request, True)\n\n    context = {\n        'root_domain_landing_page': settings.ROOT_DOMAIN_LANDING_PAGE,\n        'custom_logo_url': settings.CUSTOM_LOGO_URL,\n        'register_link_disabled': register_link_disabled,\n        'login_link_disabled': login_link_disabled,\n        'terms_of_service': settings.TERMS_OF_SERVICE,\n        'privacy_policy': settings.PRIVACY_POLICY,\n        'login_url': settings.HOME_NOT_LOGGED_IN,\n        'only_sso': settings.ONLY_SSO,\n        'external_host': settings.EXTERNAL_HOST,\n        'external_uri_scheme': settings.EXTERNAL_URI_SCHEME,\n        'realm_uri': realm_uri,\n        'realm_name': realm_name,\n        'realm_icon': realm_icon,\n        'root_domain_uri': settings.ROOT_DOMAIN_URI,\n        'apps_page_url': apps_page_url,\n        'open_realm_creation': settings.OPEN_REALM_CREATION,\n        'development_environment': settings.DEVELOPMENT,\n        'support_email': FromAddress.SUPPORT,\n        'find_team_link_disabled': find_team_link_disabled,\n        'password_min_length': settings.PASSWORD_MIN_LENGTH,\n        'password_min_guesses': settings.PASSWORD_MIN_GUESSES,\n        'jitsi_server_url': settings.JITSI_SERVER_URL,\n        'zulip_version': ZULIP_VERSION,\n        'user_is_authenticated': user_is_authenticated,\n        'settings_path': settings_path,\n        'secrets_path': secrets_path,\n        'settings_comments_path': settings_comments_path,\n        'platform': platform,\n        'allow_search_engine_indexing': allow_search_engine_indexing,\n    }\n\n    context['OPEN_GRAPH_URL'] = '%s%s' % (realm_uri, request.path)\n    if realm is not None and realm.icon_source == realm.ICON_UPLOADED:\n        context['OPEN_GRAPH_IMAGE'] = '%s%s' % (realm_uri, realm_icon)\n\n    return context\n\ndef login_context(request: HttpRequest) -> Dict[str, Any]:\n    realm = get_realm_from_request(request)\n\n    if realm is None:\n        realm_description = None\n        realm_invite_required = False\n    else:\n        realm_description = get_realm_rendered_description(realm)\n        realm_invite_required = realm.invite_required\n\n    context = {\n        'realm_invite_required': realm_invite_required,\n        'realm_description': realm_description,\n        'require_email_format_usernames': require_email_format_usernames(realm),\n        'password_auth_enabled': password_auth_enabled(realm),\n        'any_oauth_backend_enabled': any_oauth_backend_enabled(realm),\n        'two_factor_authentication_enabled': settings.TWO_FACTOR_AUTHENTICATION_ENABLED,\n    }  # type: Dict[str, Any]\n\n    if realm is not None and realm.description:\n        context['OPEN_GRAPH_TITLE'] = realm.name\n        context['OPEN_GRAPH_DESCRIPTION'] = get_realm_text_description(realm)\n\n    # Add the keys for our standard authentication backends.\n    no_auth_enabled = True\n    social_backends = []\n    for auth_backend_name in AUTH_BACKEND_NAME_MAP:\n        name_lower = auth_backend_name.lower()\n        key = \"%s_auth_enabled\" % (name_lower,)\n        is_enabled = auth_enabled_helper([auth_backend_name], realm)\n        context[key] = is_enabled\n        if is_enabled:\n            no_auth_enabled = False\n\n        # Now add the enabled social backends to the social_backends\n        # list used to generate buttons for login/register pages.\n        backend = AUTH_BACKEND_NAME_MAP[auth_backend_name]\n        if not is_enabled or backend not in SOCIAL_AUTH_BACKENDS:\n            continue\n        social_backends.append({\n            'name': backend.name,\n            'display_name': backend.auth_backend_name,\n            'login_url': reverse('login-social', args=(backend.name,)),\n            'signup_url': reverse('signup-social', args=(backend.name,)),\n            'sort_order': backend.sort_order,\n        })\n    context['social_backends'] = sorted(social_backends, key=lambda x: x['sort_order'], reverse=True)\n    context['no_auth_enabled'] = no_auth_enabled\n\n    return context\n\ndef latest_info_context() -> Dict[str, str]:\n    context = {\n        'latest_release_version': LATEST_RELEASE_VERSION,\n        'latest_major_version': LATEST_MAJOR_VERSION,\n        'latest_release_announcement': LATEST_RELEASE_ANNOUNCEMENT,\n    }\n    return context\n", "path": "zerver/context_processors.py"}]}