-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathurls.py
161 lines (149 loc) · 7.61 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
# Universal Subtitles, universalsubtitles.org
#
# Copyright (C) 2010 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
# http://www.gnu.org/licenses/agpl-3.0.html.
from django.conf.urls.defaults import *
from django.conf import settings
from socialauth.models import AuthMeta, OpenidProfile, TwitterUserProfile, FacebookUserProfile
from sitemaps import sitemaps, sitemap_view, sitemap_index
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
admin.site.unregister([AuthMeta, OpenidProfile, TwitterUserProfile, FacebookUserProfile])
# Monkeypatch the Celery admin to show a column for task run time in the list view.
from djcelery.admin import TaskMonitor
from djcelery.models import TaskState
admin.site.unregister([TaskState])
TaskMonitor.list_display += ('runtime',)
admin.site.register(TaskState, TaskMonitor)
from doorman import feature_is_on
js_info_dict = {
'packages': ('unisubs'),
}
urlpatterns = patterns(
'',
(r'^crossdomain.xml$', 'crossdomain_views.root_crossdomain'),
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict, name='js_i18n_catalog'),
(r'^$', 'videos.views.index'),
(r'^ff-bug/$', 'videos.views.bug'),
(r'^sentry/', include('sentry.web.urls')),
(r'^comments/', include('comments.urls', namespace='comments')),
(r'^messages/', include('messages.urls', namespace='messages')),
url(r'^rosetta/', include('rosetta.urls')),
(r'^pcf-targetter/', include('targetter.urls', namespace='targetter')),
url(r'^logout/', 'django.contrib.auth.views.logout', name='logout'),
url(r'^admin/password_reset/$',
'django.contrib.auth.views.password_reset',
name='password_reset'),
(r'^password_reset/done/$',
'django.contrib.auth.views.password_reset_done'),
(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
'django.contrib.auth.views.password_reset_confirm'),
(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
(r'socialauth/', include('socialauth.urls')),
(r'^admin/settings/', include('livesettings.urls')),
(r'^admin/', include(admin.site.urls)),
url(r'^embed(?P<version_no>\d+)?.js$', 'widget.views.embed', name="widget-embed"),
(r'^widget_demo/$', 'widget.views.widget_demo'),
(r'^widget_public_demo/$', 'widget.views.widget_public_demo'),
url(r'^onsite_widget/$', 'widget.views.onsite_widget', name='onsite_widget'),
url(r'^onsite_widget_resume/$', 'widget.views.onsite_widget_resume', name='onsite_widget_resume'),
(r'^widget/', include('widget.urls', namespace='widget', app_name='widget')),
(r'^jstest/(\w+)', 'jstesting.views.jstest'),
(r'^jsdemo/(\w+)', 'jsdemo.views.jsdemo'),
url(r'^pagedemo/(\w+)?$', 'pagedemo.views.pagedemo', name="pagedemo"),
(r'^videos/', include('videos.urls', namespace='videos',
app_name='videos')),
(r'^teams/', include('teams.urls', namespace='teams',
app_name='teams')),
(r'^profiles/', include('profiles.urls', namespace='profiles',
app_name='profiles')),
(r'auth/', include('auth.urls', namespace='auth',
app_name='auth')),
(r'statistic/', include('statistic.urls', namespace='statistic')),
(r'streamer/', include('streamer.urls', namespace='streamer')),
url(r'^search/', include('search.urls', 'search')),
url(r'^email-testing/', include('emails_example.urls', 'emails_example')),
url(r'^counter/$', 'videos.views.counter', name="counter"),
url(r'^uslogging/', include('uslogging.urls', 'uslogging')),
url(r'^services/$', 'django.views.generic.simple.direct_to_template',
{'template': 'services.html'}, 'services_page'),
url(r'^solutions/ngo/$', 'django.views.generic.simple.direct_to_template',
{'template': 'solutions/ngo.html'}, 'solutions_page'),
url(r'^streaming-transcript/$', 'django.views.generic.simple.direct_to_template',
{'template': 'streaming-transcript.html'}, 'streaming_transcript_demo'),
url(r'^w3c/p3p.xml$', 'django.views.generic.simple.direct_to_template',
{'template': 'p3p.xml'}),
url(r'^w3c/Policies.xml$', 'django.views.generic.simple.direct_to_template',
{'template': 'Policies.xml'}, 'policy_page'),
url(r'^demo/$', 'videos.views.demo', name="demo"),
(r'^about$', 'django.views.generic.simple.direct_to_template',
{'template': 'about.html'}, 'about_page'),
(r'^get-code/$', 'django.views.generic.simple.direct_to_template',
{'template': 'embed_page.html'}, 'get_code_page'),
(r'^dmca$', 'django.views.generic.simple.direct_to_template',
{'template': 'dmca.html'}, 'dmca_page'),
(r'^faq$', 'django.views.generic.simple.direct_to_template',
{'template': 'faq.html'}, 'faq_page'),
(r'^terms$', 'django.views.generic.simple.direct_to_template',
{'template': 'terms.html'}, 'terms_page'),
(r'^opensubtitles2010$', 'django.views.generic.simple.direct_to_template',
{'template': 'opensubtitles2010.html'}, 'opensubtitles2010_page'),
(r'^revision$', 'django.views.generic.simple.direct_to_template',
{'template': 'revision.html'}),
(r'^revision2$', 'django.views.generic.simple.direct_to_template',
{'template': 'revision2.html'}),
(r'^revision-history$', 'django.views.generic.simple.direct_to_template',
{'template': 'revision-history.html'}),
(r'^test-ogg$', 'django.views.generic.simple.direct_to_template',
{'template': 'alpha-test01-ogg.htm'}, 'test-ogg-page'),
(r'^test-mp4$', 'django.views.generic.simple.direct_to_template',
{'template': 'alpha-test01-mp4.htm'}, 'test-mp4-page'),
url(r'^sitemap\.xml$', sitemap_index, {'sitemaps': sitemaps}, name="sitemap-index"),
url(r'^sitemap-(?P<section>.+)\.xml$', sitemap_view, {'sitemaps': sitemaps}, name="sitemap"),
)
try:
from services import urls
urlpatterns += patterns('',
(r'^unisubservices/', include('services.urls', namespace='services')),
)
except ImportError:
pass
try:
from api import urls
urlpatterns += patterns('',
url(r'^api/', include('api.urls', 'api')),
)
except ImportError:
pass
if feature_is_on('MODERATION'):
urlpatterns += patterns("",
(r'^moderation/', include('teams.moderation_urls', namespace="moderation")),
)
if settings.DEBUG:
urlpatterns += patterns('',
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
(r'^user-data/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
(r'raw_template/(?P<template>.*)', 'django.views.generic.simple.direct_to_template'),
)
from django import http
from django.template import RequestContext, loader
def handler500(request, template_name='500.html'):
t = loader.get_template(template_name)
return http.HttpResponseServerError(t.render(RequestContext(request)))
import sentry_logger