-
Notifications
You must be signed in to change notification settings - Fork 1
/
urls.py
81 lines (61 loc) · 2.45 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
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
from django.contrib import admin
admin.autodiscover()
from dajaxice.core import dajaxice_autodiscover
dajaxice_autodiscover()
urlpatterns = patterns('',
(r'^feedback/', include('bug_reporting.urls')),
(r'^images/', include('images.urls')),
(r'^visualization/', include('visualization.urls')),
(r'^annotations/', include('annotations.urls')),
(r'^requests/', include('requests.urls')),
(r'^upload/', include('upload.urls')),
(r'^map/', include('map.urls')),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^accounts/', include('accounts.urls')),
(r'^messages/', include('userena.contrib.umessages.urls')),
(r'^sentry/', include('sentry.web.urls')),
(r'^%s/' % settings.DAJAXICE_MEDIA_PREFIX, include('dajaxice.urls')),
url(r'^$', 'lib.views.index', name='index'),
url(r'^about/$',
direct_to_template,
{'template': 'static/about.html'},
name='about',
),
url(r'^contact/$', 'lib.views.contact', name='contact'),
# Internationalization
(r'^i18n/', include('django.conf.urls.i18n')),
# Examples:
# url(r'^$', 'CoralNet.views.home', name='home'),
# url(r'^CoralNet/', include('CoralNet.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
if settings.DEBUG:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True, }),
)
# Custom server-error handler
def handler500(request):
"""
500 error handler which includes ``request`` in the context.
One use of this is to display a Sentry error ID on the 500 page.
Templates: `500.html`
Context: None
"""
from django.template import Context, loader
from django.http import HttpResponseServerError
t = loader.get_template('500.html')
return HttpResponseServerError(t.render(Context({
'request': request,
# It seems the user needs to be passed in manually for the
# handler500 in particular - if this is mistaken, then change it
'user': request.user,
})))