2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 08:37:14 +00:00

WORKING Dj2.2.24 & 2.2.25 py3.7

This commit is contained in:
Philip Sargent
2022-03-02 21:15:24 +00:00
parent af50d4912d
commit 601fc2cffc
12 changed files with 97 additions and 29 deletions

15
urls.py
View File

@@ -1,12 +1,11 @@
from django.conf import settings
from django.urls import path
from django.conf.urls import url, include, re_path
from django.views.generic.base import RedirectView
from django.views.generic.edit import UpdateView
from django.views.generic.list import ListView
from django.contrib import admin
from django.contrib import auth
from django.urls import reverse, resolve
from django.urls import path, reverse, resolve
from troggle.core.views import caves, statistics, survex
from troggle.core.views.scans import scansingle, singlewallet, allwallets
@@ -59,7 +58,8 @@ else:
path('/<path:filepath>', expofilessingle, name="single"), # local copy of EXPOFILES
path('', expofilessingle, {'filepath': ""}, name="single"),
]
# see https://docs.djangoproject.com/en/dev/topics/auth/default/
# The URLs provided by include('django.contrib.auth.urls') are:
# accounts/login/ [name='login']
@@ -71,6 +71,8 @@ else:
# accounts/reset/<uidb64>/<token>/ [name='password_reset_confirm']
# accounts/reset/done/ [name='password_reset_complete']
# these worked in Django 2.2.24 but failed in .25 even though we include django.contrib.auth
trogglepatterns = [
path('expofiles/', include(expofilesurls)), # intercepted by Apache, if it is running.
path('expofiles', include(expofilesurls)), # curious interaction with the include() here, not just a slash problem.
@@ -90,10 +92,9 @@ trogglepatterns = [
path('dwguploadnogit/<path:folder>', dwgupload, {'gitdisable': 'yes'}, name='dwguploadnogit'), # used in testing
# setting LOGIN_URL = '/accounts/login/' is default
# url ENDS WITH this string
re_path(r'logout/$', expologout, name='expologout'), # higher precedence than /accounts/logout
re_path(r'login/$', expologin, name='expologin'), # higher precedence than /accounts/login
#re_path(r'^accounts/', include('django.contrib.auth.urls')), # from Dj3.0, see site-packages\registration\auth_urls_classes.py
path('accounts/logout/', expologout, name='expologout'), # same as in django.contrib.auth.urls
path('accounts/login/', expologin, name='expologin'), # same as in django.contrib.auth.urls
#re_path(r'^accounts/', include('django.contrib.auth.urls')), # see site-packages\registration\auth_urls_classes.py
# Persons - nasty surname recognition logic fails for 19 people!
re_path(r'^person/(?P<first_name>[A-Z]*[a-z\-\'&;]*)[^a-zA-Z]*(?P<last_name>[a-z\-\']*[^a-zA-Z]*[\-]*[A-Z]*[a-zA-Z\-&;]*)/?', person, name="person"),