This repository has been archived by the owner on May 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurls.py
76 lines (64 loc) · 2.59 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
import os.path
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from pagetree.generic.views import PageView, EditView, InstructorView
from ccnmtlwagtail.main import views
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from wagtail.wagtailcore import urls as wagtail_urls
admin.autodiscover()
site_media_root = os.path.join(os.path.dirname(__file__), "../media")
redirect_after_logout = getattr(settings, 'LOGOUT_REDIRECT_URL', None)
auth_urls = (r'^accounts/', include('django.contrib.auth.urls'))
logout_page = (
r'^accounts/logout/$',
'django.contrib.auth.views.logout',
{'next_page': redirect_after_logout})
if hasattr(settings, 'WIND_BASE'):
auth_urls = (r'^accounts/', include('djangowind.urls'))
logout_page = (
r'^accounts/logout/$',
'djangowind.views.logout',
{'next_page': redirect_after_logout})
urlpatterns = patterns(
'',
auth_urls,
logout_page,
(r'^registration/', include('registration.backends.default.urls')),
(r'^$', views.IndexView.as_view()),
(r'^admin/', include(admin.site.urls)),
url(r'^_impersonate/', include('impersonate.urls')),
(r'^stats/$', TemplateView.as_view(template_name="stats.html")),
(r'smoketest/', include('smoketest.urls')),
(r'infranil/', include('infranil.urls')),
(r'^uploads/(?P<path>.*)$',
'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
(r'^pagetree/', include('pagetree.urls')),
(r'^quizblock/', include('quizblock.urls')),
(r'^pages/edit/(?P<path>.*)$', login_required(EditView.as_view(
hierarchy_name="main",
hierarchy_base="/pages/")),
{}, 'edit-page'),
(r'^pages/instructor/(?P<path>.*)$',
login_required(InstructorView.as_view(
hierarchy_name="main",
hierarchy_base="/pages/"))),
(r'^pages/(?P<path>.*)$', PageView.as_view(
hierarchy_name="main",
hierarchy_base="/pages/")),
url(r'^wagtail/admin/', include(wagtailadmin_urls)),
url(r'^wagtail/documents/', include(wagtaildocs_urls)),
url(r'search/$', views.search, name='search'),
# For anything not caught by a more specific rule above, hand over to
# Wagtail's serving mechanism
url(r'^wagtail/', include(wagtail_urls)),
)
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns(
'',
url(r'^__debug__/', include(debug_toolbar.urls)),
)