def config(request): permissions = load_permissions() shibboleth_endpoint = reverse('shibboleth_login') backend_host = urlparse.urljoin(get_root_url(), API_ENDPOINT) backend_media_root = urlparse.urljoin(get_root_url(), MEDIA_URL) version_file = os.path.join(BASE_DIR, '../version') with open(version_file) as f: version = f.read().replace('\n', '') config_data = { 'permissions': permissions, 'shibboleth_login_url': shibboleth_endpoint, 'backend_host': backend_host, 'backend_media_root': backend_media_root, 'resources': load_resources(), 'version': version } return HttpResponse(json.dumps(config_data), content_type='application/json')
def current_site_baseurl(): return get_root_url()
def current_site_url(): return get_root_url() + "/api"