Revision 2a54b2dd snf-pithos-app/pithos/api/settings.py
b/snf-pithos-app/pithos/api/settings.py | ||
---|---|---|
1 | 1 |
#coding=utf8 |
2 | 2 |
from django.conf import settings |
3 | 3 |
from synnefo.lib import parse_base_url |
4 |
from astakosclient import astakos_services |
|
5 |
from synnefo.util.keypath import get_path |
|
6 |
from pithos.api.services import pithos_services |
|
4 | 7 |
|
5 | 8 |
# Top-level URL for Pithos. Must set. |
6 | 9 |
BASE_URL = getattr(settings, 'PITHOS_BASE_URL', |
7 |
"https://pithos.example.synnefo.org/")
|
|
10 |
"https://object-store.example.synnefo.org/pithos/")
|
|
8 | 11 |
|
9 | 12 |
BASE_HOST, BASE_PATH = parse_base_url(BASE_URL) |
10 | 13 |
|
14 |
# Process Astakos settings |
|
11 | 15 |
ASTAKOS_BASE_URL = getattr(settings, 'ASTAKOS_BASE_URL', |
12 |
"https://accounts.example.synnefo.org/") |
|
13 |
|
|
16 |
'https://accounts.example.synnefo.org/astakos/') |
|
14 | 17 |
ASTAKOS_BASE_HOST, ASTAKOS_BASE_PATH = parse_base_url(ASTAKOS_BASE_URL) |
15 | 18 |
|
19 |
PITHOS_PREFIX = get_path(pithos_services, 'pithos_object-store.prefix') |
|
20 |
PUBLIC_PREFIX = get_path(pithos_services, 'pithos_public.prefix') |
|
21 |
UI_PREFIX = get_path(pithos_services, 'pithos_ui.prefix') |
|
22 |
|
|
23 |
CUSTOMIZE_ASTAKOS_SERVICES = \ |
|
24 |
getattr(settings, 'PITHOS_CUSTOMIZE_ASTAKOS_SERVICES', ()) |
|
25 |
for path, value in CUSTOMIZE_ASTAKOS_SERVICES: |
|
26 |
set_path(astakos_services, path, value, createpath=True) |
|
27 |
|
|
28 |
ASTAKOS_ACCOUNT_PREFIX = get_path(astakos_services, 'astakos_account.prefix') |
|
29 |
|
|
16 | 30 |
BASE_ASTAKOS_PROXY_PATH = getattr(settings, 'PITHOS_BASE_ASTAKOS_PROXY_PATH', |
17 | 31 |
ASTAKOS_BASE_PATH) |
18 | 32 |
|
19 |
ASTAKOS_ACCOUNTS_PREFIX = getattr(settings, 'ASTAKOS_ACCOUNTS_PREFIX', |
|
20 |
'accounts') |
|
21 | 33 |
|
22 | 34 |
ASTAKOSCLIENT_POOLSIZE = getattr(settings, 'PITHOS_ASTAKOSCLIENT_POOLSIZE', 200) |
23 | 35 |
|
Also available in: Unified diff