reviewboard.admin.server¶
Functions for retrieving server information.
- get_server_url(local_site_name=None, local_site=None, request=None)[source]¶
Return the URL for the root of the server.
This will construct a URL that points to the root of the server, factoring in whether to use HTTP or HTTPS.
If
local_site_name
orlocal_site
is provided, then the URL will be the root to the LocalSite’s root, rather than the server’s root.If
request
is provided, then the Local Site, if any, will be inferred from the request.
- build_server_url(path=None, **kwargs)[source]¶
Build an absolute URL containing the full URL to the server.
A path can be supplied that will be joined to the server URL.
- Parameters:
path (
unicode
) – The path to append to the server URL.**kwargs (
dict
) – Additional arguments to pass toget_server_url()
.
- Returns:
The resulting URL.
- Return type:
- get_hostname()[source]¶
Return the hostname for this Review Board server.
- Returns:
The hostname for the server.
- Return type:
- get_data_dir() str [source]¶
Return the path to the site’s data directory.
This is always based on
$HOME
. If this variable is not set, or the path does not exist, then an exception will be raised.New in version 6.0.
- Returns:
The path to the data directory.
- Return type:
- Raises:
django.core.exceptions.ImproperlyConfigured – The data directory path could not be found or does not exist. Details are in the error message.