Future-proof for django 4.0 #27

Open
bclement wants to merge 1 commit from bclement/future into main
3 changed files with 13 additions and 12 deletions

View file

@ -7,9 +7,12 @@ from django.contrib.messages import constants as messages
try:
from . import secret
except ImportError:
import pathlib
dir_path = pathlib.Path(__file__).parent.resolve().as_posix()
raise ImportError(
"The secret.py file is missing.\n"
"For a development environment, simply copy secret_example.py"
"For a development environment, simply copy secret_example.py:\n"
f" $ cp {dir_path}/{{secret_example,secret}}.py"
)

View file

@ -1,23 +1,22 @@
from django.conf.urls import url, include
from django.conf.urls import include
from django.urls import re_path
from django.contrib import admin
from allauth_ens.views import capture_login, capture_logout
from wiki.urls import get_pattern as get_wiki_pattern
from django_nyt.urls import get_pattern as get_nyt_pattern
allauth_urls = [
# Catch login/logout views of admin site.
url(r'^_admin/login/$', capture_login),
url(r'^_admin/logout/$', capture_logout),
re_path(r'^_admin/login/$', capture_login),
re_path(r'^_admin/logout/$', capture_logout),
# Allauth urls.
url(r'^_profil/', include('allauth.urls')),
re_path(r'^_profil/', include('allauth.urls')),
]
urlpatterns = allauth_urls + [
url(r'^_admin/', admin.site.urls),
url(r'^notifications/', get_nyt_pattern()),
url(r'^_groups/', include("wiki_groups.urls")),
url(r'', get_wiki_pattern()),
re_path(r'^_admin/', admin.site.urls),
re_path(r'^notifications/', include('django_nyt.urls')),
re_path(r'^_groups/', include("wiki_groups.urls")),
re_path(r'', include('wiki.urls')),
]
# TODO add MEDIA_ROOT

View file

@ -1 +0,0 @@
default_app_config = "wiki_groups.apps.WikiGroupsConfig"