Revision aa153e99 snf-pithos-app/pithos/api/urls.py
b/snf-pithos-app/pithos/api/urls.py | ||
---|---|---|
31 | 31 |
# interpreted as representing official policies, either expressed |
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 |
from functools import partial |
|
35 |
|
|
34 | 36 |
from django.conf.urls.defaults import include, patterns |
37 |
from django.views.decorators.csrf import csrf_exempt |
|
38 |
|
|
39 |
from snf_django.lib.api.proxy import proxy |
|
35 | 40 |
|
36 | 41 |
import pithos.api.settings as settings |
37 | 42 |
|
43 |
astakos_proxy = partial(proxy, target=settings.ASTAKOS_URL) |
|
44 |
|
|
38 | 45 |
# TODO: This only works when in this order. |
39 | 46 |
api_urlpatterns = patterns( |
40 | 47 |
'pithos.api.functions', |
... | ... | |
54 | 61 |
if settings.PROXY_USER_SERVICES: |
55 | 62 |
urlpatterns += patterns( |
56 | 63 |
'', |
57 |
(r'^login/?$', 'pithos.api.delegate.delegate_to_login_service'), |
|
58 |
(r'^feedback/?$', 'pithos.api.delegate.delegate_to_feedback_service'), |
|
59 |
(r'^user_catalogs/?$', 'pithos.api.delegate.delegate_to_user_catalogs_service')) |
|
64 |
(r'^login/?$', csrf_exempt(astakos_proxy)), |
|
65 |
(r'^feedback/?$', csrf_exempt(astakos_proxy)), |
|
66 |
(r'^user_catalogs/?$', csrf_exempt(astakos_proxy)), |
|
67 |
(r'^astakos/api/', csrf_exempt(astakos_proxy)) |
|
68 |
) |
Also available in: Unified diff