From a950cc60d9400c553b853f3a3308edaa8ea645cc Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 19 Feb 2025 16:00:53 +0200 Subject: tidy trailing slash everywhere & fix tests --- settings.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 486d494..e8a0022 100644 --- a/settings.py +++ b/settings.py @@ -113,7 +113,7 @@ FORM_RENDERER = "django.forms.renderers.TemplatesSetting" # Required to customi # see https://docs.djangoproject.com/en/dev/topics/http/middleware/#upgrading-pre-django-1-10-style-middleware # Seriously, read this: https://www.webforefront.com/django/middlewaredjango.html which is MUCH BETTER than the docs -# We are NOT using the home-built SmartAppendSlashMiddleware +# We are NOT using the home-built TroggleAppendSlashMiddleware, NOR are we using the Django system append_slash MIDDLEWARE = [ #'django.middleware.security.SecurityMiddleware', # SECURE_SSL_REDIRECT and SECURE_SSL_HOST # we don't use this "django.middleware.gzip.GZipMiddleware", # not needed when expofiles and photos served by apache @@ -128,11 +128,12 @@ MIDDLEWARE = [ #"troggle.core.middleware.TroggleAppendSlashMiddleware", # modified Feb.2025 ] -WSGI_APPLICATION = "troggle.wsgi.application" # change to asgi as soon as we upgrade to Django 3.0 +WSGI_APPLICATION = "troggle.wsgi.application" # change to asgi as soon as we upgrade to Django 5 ? # Append slash can't work if we have a universal catchall URL rule, and we do because all the handbook files # do not have simple prefix. This is why we used to have an /expoweb/ prefix for everything in the website. -# APPEND_SLASH = True # using django.middleware.common.CommonMiddleware. Pointless, never happens if there is a catchall. -# TROGGLE_APPEND_SLASH = True # this is our middleware: see the code in troggle/core/middleware.py for why we do NOT use it. +# Also site-media etc. +APPEND_SLASH = False # using django.middleware.common.CommonMiddleware which we need for other things (I think). + QM_PATTERN = r"\[\[\s*[Qq][Mm]:([ABC]?)(\d{4})-(\d*)-(\d*)\]\]" # Re-enable TinyMCE when Dj upgraded to v3. Also templates/editexpopage.html -- cgit v1.2.3