-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathurls.py
52 lines (45 loc) · 1.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
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.urls import include, path, re_path
from django.views.generic import TemplateView
from sesame.views import LoginView as SesameLoginView
def trigger_error(request):
return 1 / 0
urlpatterns = [
re_path(r"^parties/", include("parties.urls")),
re_path(r"^", include("api.urls")),
re_path(r"^", include("elections.urls")),
re_path(r"", include("facebook_data.urls")),
re_path(r"^", include("candidates.urls")),
re_path(r"^", include("people.urls")),
re_path(r"^", include("search.urls")),
re_path(r"^admin/doc/", include("django.contrib.admindocs.urls")),
re_path(r"^admin/", admin.site.urls),
path("sesame/login/", SesameLoginView.as_view(), name="sesame-login"),
re_path(r"^upload_document/", include("official_documents.urls")),
re_path(r"^results/", include("results.urls")),
re_path(r"^duplicates/", include("duplicates.urls")),
re_path(r"^accounts/", include("wombles.urls", namespace="wombles")),
re_path(r"^data/", include("data_exports.urls")),
path(
"volunteer/",
TemplateView.as_view(template_name="volunteer.html"),
name="volunteer-view",
),
re_path(r"", include("ynr_refactoring.urls")),
re_path(
r"^robots\.txt$",
TemplateView.as_view(
template_name="robots.txt", content_type="text/plain"
),
),
path("sentry-debug/", trigger_error),
]
if settings.DEBUG:
import debug_toolbar
urlpatterns += [re_path(r"^__debug__/", include(debug_toolbar.urls))]
if settings.DEBUG or getattr(settings, "RUNNING_TESTS", False):
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)