urls.py 3.5 KB
Newer Older
Antony Chazapis's avatar
Antony Chazapis committed
1
# Copyright 2011-2012 GRNET S.A. All rights reserved.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
# 
#   1. Redistributions of source code must retain the above
#      copyright notice, this list of conditions and the following
#      disclaimer.
# 
#   2. Redistributions in binary form must reproduce the above
#      copyright notice, this list of conditions and the following
#      disclaimer in the documentation and/or other materials
#      provided with the distribution.
# 
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# 
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
34
from django.conf.urls.defaults import patterns, include, url
35

36
from astakos.im.forms import ExtendedPasswordResetForm
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
37
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, PROJECT_PATH
38

39
urlpatterns = patterns('astakos.im.views',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
40
41
42
43
44
    url(r'^$', 'index'),
    url(r'^login/?$', 'index'),
    url(r'^profile/?$', 'edit_profile'),
    url(r'^feedback/?$', 'send_feedback'),
    url(r'^signup/?$', 'signup'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
45
    url(r'^logout/?$', 'logout'),
Antony Chazapis's avatar
Antony Chazapis committed
46
    url(r'^activate/?$', 'activate')
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
47
48
)

49
urlpatterns += patterns('astakos.im.target',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
50
    url(r'^login/redirect/?$', 'redirect.login')
51
52
53
)

urlpatterns += patterns('',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
54
    url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
55
                                {'document_root': PROJECT_PATH + '/im/static'})
56
57
)

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
58
if 'local' in IM_MODULES:
59
    urlpatterns += patterns('astakos.im.target',
60
        url(r'^local/?$', 'local.login')
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
61
62
    )
    urlpatterns += patterns('django.contrib.auth.views',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
63
        url(r'^local/password_reset/?$', 'password_reset',
64
65
         {'email_template_name':'registration/password_email.txt',
          'password_reset_form':ExtendedPasswordResetForm}),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
66
67
        url(r'^local/password_reset_done/?$', 'password_reset_done'),
        url(r'^local/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
68
         'password_reset_confirm'),
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
69
70
        url(r'^local/password/reset/complete/$', 'password_reset_complete'),
        url(r'^password/?$', 'password_change', {'post_change_redirect':'profile'})
71
72
    )

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
73
if INVITATIONS_ENABLED:
74
    urlpatterns += patterns('astakos.im.views',
Antony Chazapis's avatar
Antony Chazapis committed
75
        url(r'^invite/?$', 'invite')
76
77
    )

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
78
if 'shibboleth' in IM_MODULES:
79
    urlpatterns += patterns('astakos.im.target',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
80
        url(r'^login/shibboleth/?$', 'shibboleth.login')
81
82
    )

Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
83
if 'twitter' in IM_MODULES:
84
    urlpatterns += patterns('astakos.im.target',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
85
86
        url(r'^login/twitter/?$', 'twitter.login'),
        url(r'^login/twitter/authenticated/?$', 'twitter.authenticated')
87
88
89
    )

urlpatterns += patterns('astakos.im.api',
Sofia Papagiannaki's avatar
Sofia Papagiannaki committed
90
    url(r'^authenticate/?$', 'authenticate')
91
)