-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathurls.py
206 lines (184 loc) · 7.85 KB
/
urls.py
1
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.contrib.auth.views import login, logout, password_change
#admin interface
from django.contrib import admin
admin.autodiscover()
PASSWORD_CHANGE_DICT = {
'template_name': 'users/password_change.html',
'post_change_redirect': '/accounts/password_change/done/'
# 'post_change_redirect': '/accounts/settings/'
}
PASSWORD_RESET_DICT = {
'post_reset_redirect': '/accounts/password_reset/done/',
'email_template_name': 'users/mails/password_reset.html',
'template_name': 'users/password_reset.html'
}
PASSWORD_RESET_CONFIRM_DICT = {
'post_reset_redirect': '/accounts/password_reset/complete/',
'template_name': 'users/password_reset_confirm.html',
}
#if settings.DEBUG:
# urlpatterns = patterns('',
urlpatterns = patterns('',
#####
##### Web Endpoints
##### Used by Admin and others
#####
#main_page
url(r'^$', 'device.views.main_page'),
#Status Monitor for admin
#url(r'^admin/statusmonitor/$', 'admin.views.status_monitor'),
#Admin interface for django version 1.3
url(r'^admin/', include(admin.site.urls)),
#login page
url(r'^login/$', login, {'template_name': 'users/login.html'}, name='login'),
#logout page
url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),
#signup page
#url(r'^register/$', 'users.views.register'),
# Information for participants
url(r'^info/$', 'users.views.info'),
#download participant agreement
url(r'^info/agreement/$', 'users.views.download_agreement'),
#participant interest form
# url(r'^join/$', 'users.views.participant'),
#Participant Register and device Register Form
url(r'^register_developer/$', 'users.views.register_developer'),
#Participant Register and device Register Form
url(r'^participant_register/$', 'users.views.participant_register'),
#Participant Register and device Register Form
url(r'^confirm_participant_register/$', 'users.views.confirm_participant_register'),
#profile page
url(r'^accounts/profile/$', 'users.views.profile'),
#delete member from group
#url(r'^accounts/delete_member/(?P<member>\w+)/$', 'users.views.delete_member'),
#group profile
#url(r'^accounts/group_profile/$', 'users.views.group_profile'),
# Update User Profile Form [POST]
url(r'^accounts/(?P<userId>\d+)/update/$', 'users.views.update'),
#signup authorization page
#url(r'^accounts/authorize/(?P<groupname>\w+)/(?P<activation_key>[a-z0-9]\w+)/$', 'users.views.authorize'),
#signup confirm page
url(r'^accounts/confirm/(?P<activation_key>[a-z0-9]\w+)/$', 'users.views.confirm'),
#change password
url(r'^accounts/password_change/$', password_change, PASSWORD_CHANGE_DICT, name='password_change'),
#change password
url(r'^accounts/password_change/done/$', 'django.contrib.auth.views.password_change_done', {'template_name': 'users/password_change_done.html'}),
#Password Reset
url(r'^accounts/password_reset/$', 'django.contrib.auth.views.password_reset', PASSWORD_RESET_DICT),
#Password Reset Done
url(r'^accounts/password_reset/done/$', 'django.contrib.auth.views.password_reset_done', {'template_name': 'users/password_reset_done.html'}),
#Password Reset Confirm
url(r'^accounts/password_reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', PASSWORD_RESET_CONFIRM_DICT),
#Password Reset Complete
url(r'^accounts/password_reset/complete/$', 'django.contrib.auth.views.password_reset_complete', {'template_name': 'users/password_reset_complete.html'}),
#
## Device
#
# All Devices [GET]
url(r'^devices/$', 'device.views.index'),
# Single Device [GET]
url(r'^device/(?P<deviceId>\d+)/$', 'device.views.show'),
# Edit Device Form [GET]
url(r'^device/(?P<deviceId>\d+)/edit/$', 'device.views.edit'),
# Update Device Form [POST]
url(r'^device/(?P<deviceId>\d+)/update/$', 'device.views.update'),
# REFACTOR: C2DM [POST]
url(r'^device/(?P<deviceId>\d+)/c2dm/$', 'device.views.c2dm'),
# Log Tag filter[GET]
url(r'^device/(?P<deviceId>\d+)/tag/$', 'datalogger.views.show_tag'),
# Phone Status [GET]
url(r'^device/(?P<deviceId>\d+)/status/(?P<statusType>\d{1})/$', 'device.views.status'),
# Log Data [GET]
url(r'^device/(?P<deviceId>\d+)/(?P<logFilename>[0-9]\w+).log$', 'datalogger.views.show'),
# Update Status
# url(r'^device/(?P<deviceId>[A-Z0-9]\w+)/update/status/$', 'device.views.update_status'),
#
## Application
#
# All Applications [GET]
url(r'^applications/$', 'application.views.index'),
# Single Application [GET]
url(r'^application/(?P<appId>\d+)/$', 'application.views.show'),
# New Application Form [GET]
url(r'^application/new/$', 'application.views.new'),
# Withdraw Application
url(r'^application/withdraw/(?P<appId>\d+)/$', 'application.views.withdraw'),
# Edit Application Form [GET]
#url(r'^application/(?P<appId>[A-Z0-9]\w+)/edit/$', 'application.views.edit'),
# Create/Update Application [POST]
url(r'^application/$', 'application.views.create_or_update_application'),
#
## Experiment
#
#All experiments
url(r'^experiments/$', 'experiment.views.index' ),
# Single Experiment
url(r'^experiment/(?P<expId>\d+)/$', 'experiment.views.show'),
#Delete Experiment
url(r'^experiment/delete_exp/(?P<expId>\d+)/$', 'experiment.views.delete_exp'),
#remove Member
url(r'^experiment/add_member/(?P<expId>\d+)/$', 'experiment.views.add_member'),
#Delete Device
url(r'^experiment/join_member/(?P<expId>\d+)/(?P<userId>\d+)/$', 'experiment.views.join_member'),
#Delete Application
#url(r'^experiment/delete_app/(?P<expId>\d+)/(?P<appId>\d+)/$', 'experiment.views.delete_app'),
#New Experiment form [GET]
url(r'^experiment/new/$', 'experiment.views.new'),
# Create or Update experiment [POST]
url(r'^experiment/$', 'experiment.views.create_experiment' ),
#Update Experiment Profile [POST]
url(r'^experiment/update/(?P<expId>\d+)/$', 'experiment.views.update' ),
# download IRB Letter
url(r'^experiment/irb/(?P<irbId>\d+).pdf/$', 'experiment.views.download_irb' ),
#
## Transaction
#
# Get Transaction info [GET]
url(r'^transactions/$', 'transaction.views.index'),
# Transaction create [POST]
# TransactionDevapp create
url(r'^transaction/create/$', 'transaction.views.create'),
# Get Transaction view [GET]
url(r'^transaction/(?P<Id>\w+)/(?P<Type>\d)/$', 'transaction.views.show'),
#####
##### API Endpoints
##### Used by PhoneLab Application on Device
#####
#
## Device
#
# New device registration [POST]
# Update Previous device registration [POST]
# Accepts: {}
# Response : {}
url(r'^device/$', 'device.views.create_or_update_device'),
# Insert transaction related [POST]
# Update transaction related [POST]
# Accepts: {}
# Response : {}
url(r'^deviceapplication/$', 'device.views.insert_or_update_deviceapplication'),
# Device Status [POST]
url(r'^devicestatus/$', 'device.views.device_status'),
#
## Manifest
#
# Download Manifest [GET]
url(r'^manifest/(?P<deviceId>[A-Z0-9]\w+)/$', 'manifest.views.download_manifest'),
#
## Logger
#
# POST Logfiles [POST]
url(r'^log/(?P<deviceId>[A-Z0-9]\w+)/$', 'datalogger.views.upload_log'),
#
## Application
#
# Download Application [GET]
url(r'^application/(?P<appId>\d+).apk/$', 'application.views.get_download'),
#
## Error
## TODO
# Error Handling [POST]
# url(r'^error/(?P<deviceId>[A-Z0-9]\w+)/$', 'error.views.create_error'),
)