urls.py 2.83 KB
Newer Older
hynek's avatar
hynek committed
1
2
3
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
hynek's avatar
hynek committed
4
from django.urls import include, path
hynek's avatar
hynek committed
5
6
from django.views import defaults as default_views

7
8
9
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail.core import urls as wagtail_urls
hynek's avatar
hynek committed
10

11
12
13
14
from discuss_data.core.views import (
    landing_page,
    about_page,
)
hynek's avatar
hynek committed
15
from discuss_data.ddusers.views import following_act_feed
16

17

hynek's avatar
hynek committed
18
urlpatterns = [
hynek's avatar
hynek committed
19
20
21
22
23
24
    # remove next 4 lines and template files!
    # path("", TemplateView.as_view(template_name="pages/home.html"), name="home"),
    # path(
    #    "about/", TemplateView.as_view(template_name="pages/about.html"), name="about"
    # ),
    # Django Admin, use {% url 'admin:index' %}
25
    path(settings.ADMIN_URL + "doc/", include("django.contrib.admindocs.urls")),
hynek's avatar
hynek committed
26
27
    path(settings.ADMIN_URL, admin.site.urls),
    # User management
28
29
30
    path(
        "users/", include(("discuss_data.ddusers.urls", "ddusers"), namespace="ddusers")
    ),
hynek's avatar
hynek committed
31
    # Your stuff: custom urls includes go here
32
    path("core/", include(("discuss_data.core.urls", "core"), namespace="core")),
33
34
35
36
37
38
39
    # path(
    #    "publication/",
    #    include(
    #        ("discuss_data.ddpublications.urls", "ddpublications"),
    #        namespace="ddpublications",
    #    ),
    # ),
40
    path("dataset/", include("discuss_data.dddatasets.urls", namespace="dddatasets")),
41
    path("dhrep/", include("discuss_data.dhrep.urls", namespace="dhrep")),
42
    path("shib/", include("shibboleth.urls", namespace="shibboleth")),
43
    path("", landing_page, name="core.landing_page"),
44
    path("about/", about_page, name="core.about_page"),
45
    path("dashboard/", following_act_feed, name="ddusers.dashboard_page"),
hynek's avatar
hynek committed
46
47
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

48
49
# wagtail URL def
urlpatterns += [
50
51
52
    path("cms/", include(wagtailadmin_urls)),
    path("documents/", include(wagtaildocs_urls)),
    path("documentation/", include(wagtail_urls)),
53
54
]

hynek's avatar
hynek committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
if settings.DEBUG:
    # This allows the error pages to be debugged during development, just visit
    # these url in browser to see how these error pages look like.
    urlpatterns += [
        path(
            "400/",
            default_views.bad_request,
            kwargs={"exception": Exception("Bad Request!")},
        ),
        path(
            "403/",
            default_views.permission_denied,
            kwargs={"exception": Exception("Permission Denied")},
        ),
        path(
            "404/",
            default_views.page_not_found,
            kwargs={"exception": Exception("Page not Found")},
        ),
        path("500/", default_views.server_error),
    ]
    if "debug_toolbar" in settings.INSTALLED_APPS:
        import debug_toolbar

79
        urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns