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
|
from allauth.account.views import LogoutView
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 AccountDeleteView, AccountSettingsView, HomeView
app_name = 'home'
urlpatterns = [
# We do this twice because Allauth expects specific view names to exist
path('', HomeView.as_view(), name='home'),
path('', HomeView.as_view(), name='socialaccount_connections'),
path('pages/', include('wiki.urls')),
path('accounts/', include('allauth.socialaccount.providers.discord.urls')),
path('accounts/', include('allauth.socialaccount.providers.github.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('accounts/settings', AccountSettingsView.as_view(), name="account_settings"),
path('accounts/delete', AccountDeleteView.as_view(), name="account_delete"),
path('logout', LogoutView.as_view(), name="logout"),
path('admin/', admin.site.urls),
path('notifications/', include('django_nyt.urls')),
path('resources/', include('pydis_site.apps.resources.urls', namespace="resources")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|