Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / urls.py @ f6ff3033

History | View | Annotate | Download (2.7 kB)

1 a9658bb2 Kostas Papadimitriou
# Copyright 2011-2012 GRNET S.A. All rights reserved.
2 a9658bb2 Kostas Papadimitriou
#
3 a9658bb2 Kostas Papadimitriou
# Redistribution and use in source and binary forms, with or
4 a9658bb2 Kostas Papadimitriou
# without modification, are permitted provided that the following
5 a9658bb2 Kostas Papadimitriou
# conditions are met:
6 a9658bb2 Kostas Papadimitriou
#
7 a9658bb2 Kostas Papadimitriou
#   1. Redistributions of source code must retain the above
8 a9658bb2 Kostas Papadimitriou
#      copyright notice, this list of conditions and the following
9 a9658bb2 Kostas Papadimitriou
#      disclaimer.
10 a9658bb2 Kostas Papadimitriou
#
11 a9658bb2 Kostas Papadimitriou
#   2. Redistributions in binary form must reproduce the above
12 a9658bb2 Kostas Papadimitriou
#      copyright notice, this list of conditions and the following
13 a9658bb2 Kostas Papadimitriou
#      disclaimer in the documentation and/or other materials
14 a9658bb2 Kostas Papadimitriou
#      provided with the distribution.
15 a9658bb2 Kostas Papadimitriou
#
16 a9658bb2 Kostas Papadimitriou
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 a9658bb2 Kostas Papadimitriou
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 a9658bb2 Kostas Papadimitriou
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 a9658bb2 Kostas Papadimitriou
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 a9658bb2 Kostas Papadimitriou
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 a9658bb2 Kostas Papadimitriou
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 a9658bb2 Kostas Papadimitriou
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 a9658bb2 Kostas Papadimitriou
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 a9658bb2 Kostas Papadimitriou
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 a9658bb2 Kostas Papadimitriou
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 a9658bb2 Kostas Papadimitriou
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 a9658bb2 Kostas Papadimitriou
# POSSIBILITY OF SUCH DAMAGE.
28 a9658bb2 Kostas Papadimitriou
#
29 a9658bb2 Kostas Papadimitriou
# The views and conclusions contained in the software and
30 a9658bb2 Kostas Papadimitriou
# documentation are those of the authors and should not be
31 a9658bb2 Kostas Papadimitriou
# interpreted as representing official policies, either expressed
32 a9658bb2 Kostas Papadimitriou
# or implied, of GRNET S.A.
33 a9658bb2 Kostas Papadimitriou
34 6b256427 Christos Stavrakakis
from django.conf.urls import include, patterns
35 a6b17d33 Christos Stavrakakis
36 e3ff6830 Georgios D. Tsoukalas
from astakos.im.settings import (
37 c8a38c0e Christos Stavrakakis
    BASE_PATH, ACCOUNTS_PREFIX, VIEWS_PREFIX, KEYSTONE_PREFIX, WEBLOGIN_PREFIX,
38 c8a38c0e Christos Stavrakakis
    ADMIN_PREFIX)
39 e3ff6830 Georgios D. Tsoukalas
from snf_django.lib.api.utils import prefix_pattern
40 347b2ba1 Giorgos Korfiatis
from snf_django.utils.urls import \
41 347b2ba1 Giorgos Korfiatis
    extend_with_root_redirects, extend_endpoint_with_slash
42 347b2ba1 Giorgos Korfiatis
from astakos.im.settings import astakos_services
43 347b2ba1 Giorgos Korfiatis
44 347b2ba1 Giorgos Korfiatis
urlpatterns = []
45 347b2ba1 Giorgos Korfiatis
46 347b2ba1 Giorgos Korfiatis
# Redirects should be first, otherwise they may get overridden by wildcards
47 347b2ba1 Giorgos Korfiatis
extend_endpoint_with_slash(urlpatterns, astakos_services, 'astakos_ui')
48 347b2ba1 Giorgos Korfiatis
extend_endpoint_with_slash(urlpatterns, astakos_services, 'astakos_weblogin')
49 a9658bb2 Kostas Papadimitriou
50 e3ff6830 Georgios D. Tsoukalas
astakos_patterns = patterns(
51 79b5d61b Sofia Papagiannaki
    '',
52 e3ff6830 Georgios D. Tsoukalas
    (prefix_pattern(VIEWS_PREFIX), include('astakos.im.urls')),
53 e3ff6830 Georgios D. Tsoukalas
    (prefix_pattern(ACCOUNTS_PREFIX), include('astakos.api.urls')),
54 6e416d7b Georgios D. Tsoukalas
    (prefix_pattern(KEYSTONE_PREFIX), include('astakos.api.keystone_urls')),
55 bdb325a1 Georgios D. Tsoukalas
    (prefix_pattern(WEBLOGIN_PREFIX), include('astakos.im.weblogin_urls')),
56 c8a38c0e Christos Stavrakakis
    (prefix_pattern(ADMIN_PREFIX), include('astakos.admin.admin_urls')),
57 e3ff6830 Georgios D. Tsoukalas
)
58 e3ff6830 Georgios D. Tsoukalas
59 e3ff6830 Georgios D. Tsoukalas
60 347b2ba1 Giorgos Korfiatis
urlpatterns += patterns(
61 e3ff6830 Georgios D. Tsoukalas
    '',
62 e3ff6830 Georgios D. Tsoukalas
    (prefix_pattern(BASE_PATH), include(astakos_patterns)),
63 79b5d61b Sofia Papagiannaki
)
64 04db5f81 Kostas Papadimitriou
65 04db5f81 Kostas Papadimitriou
# set utility redirects
66 347b2ba1 Giorgos Korfiatis
extend_with_root_redirects(urlpatterns, astakos_services,
67 04db5f81 Kostas Papadimitriou
                           'astakos_ui', BASE_PATH)