aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/home/urls.py
blob: 211a7ad1683a7f73d5b55c52a9e99d6bcc8185e4 (plain) (blame)
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
from allauth.account.views import LogoutView
from allauth.socialaccount.views import ConnectionsView
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.messages import ERROR
from django.urls import include, path

from pydis_site.utils.views import MessageRedirectView
from .views import HomeView

app_name = 'home'
urlpatterns = [
    path('', HomeView.as_view(), name='home'),
    path('pages/', include('wiki.urls')),

    path('accounts/', include('allauth.socialaccount.providers.discord.urls')),

    path(
        'accounts/login/cancelled', MessageRedirectView.as_view(
            pattern_name="home", message="Login cancelled."
        ), name='socialaccount_login_cancelled'
    ),
    path(
        'accounts/login/error', MessageRedirectView.as_view(
            pattern_name="home", message="Login encountered an unknown error, please try again.",
            message_level=ERROR
        ), name='socialaccount_login_error'
    ),

    path('connections', ConnectionsView.as_view()),
    path('logout', LogoutView.as_view(), name="logout"),

    path('admin/', admin.site.urls),
    path('notifications/', include('django_nyt.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)