Future-proof for django 4.0 #27
3 changed files with 13 additions and 12 deletions
|
@ -7,9 +7,12 @@ from django.contrib.messages import constants as messages
|
||||||
try:
|
try:
|
||||||
from . import secret
|
from . import secret
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
import pathlib
|
||||||
|
dir_path = pathlib.Path(__file__).parent.resolve().as_posix()
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"The secret.py file is missing.\n"
|
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 django.contrib import admin
|
||||||
|
|
||||||
from allauth_ens.views import capture_login, capture_logout
|
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 = [
|
allauth_urls = [
|
||||||
# Catch login/logout views of admin site.
|
# Catch login/logout views of admin site.
|
||||||
url(r'^_admin/login/$', capture_login),
|
re_path(r'^_admin/login/$', capture_login),
|
||||||
url(r'^_admin/logout/$', capture_logout),
|
re_path(r'^_admin/logout/$', capture_logout),
|
||||||
# Allauth urls.
|
# Allauth urls.
|
||||||
url(r'^_profil/', include('allauth.urls')),
|
re_path(r'^_profil/', include('allauth.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
urlpatterns = allauth_urls + [
|
urlpatterns = allauth_urls + [
|
||||||
url(r'^_admin/', admin.site.urls),
|
re_path(r'^_admin/', admin.site.urls),
|
||||||
url(r'^notifications/', get_nyt_pattern()),
|
re_path(r'^notifications/', include('django_nyt.urls')),
|
||||||
url(r'^_groups/', include("wiki_groups.urls")),
|
re_path(r'^_groups/', include("wiki_groups.urls")),
|
||||||
url(r'', get_wiki_pattern()),
|
re_path(r'', include('wiki.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
# TODO add MEDIA_ROOT
|
# TODO add MEDIA_ROOT
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
default_app_config = "wiki_groups.apps.WikiGroupsConfig"
|
|
Loading…
Reference in a new issue