flatpages to expopages

This commit is contained in:
Philip Sargent
2021-03-31 16:14:36 +01:00
parent 577bd51613
commit 3452c2c5d4
6 changed files with 19 additions and 18 deletions

23
urls.py
View File

@@ -10,7 +10,7 @@ from troggle.core import views_other, views_caves, views_logbooks, views_statist
from troggle.core.views_other import troggle404
from troggle.core.views_caves import ent, prospecting_image
from troggle.core.views_statistics import pathsreport, stats
from troggle.core.views_expo import expofiles_redirect, expofilessingle, flatpage, editflatpage
from troggle.core.views_expo import expofiles_redirect, expofilessingle, expopage, editexpopage
"""This sets the actualurlpatterns[] and urlpatterns[] lists which django uses
to resolve urls - in both directions as these are declarative.
@@ -33,16 +33,16 @@ The API urls return TSV or JSON and are new in July 2020.
if settings.EXPOFILESREMOTE:
expofilesurls = [
url(r'^/*(?P<path>.*)$', expofiles_redirect, name="expofiles_redirect"), # to expo.survex.com/expofiles
url(r'^(?P<path>.*)$', expofiles_redirect, name="expofiles_redirect"), # to expo.survex.com/expofiles
]
else:
expofilesurls = [
url(r'^/*(?P<filepath>.*)$', expofilessingle, name="single"), # local copy of EXPOFILES
url(r'^(?P<filepath>.*)$', expofilessingle, name="single"), # local copy of EXPOFILES
]
actualurlpatterns = [
url(r'^expofiles', include(expofilesurls)),
trogglepatterns = [
url(r'^expofiles/', include(expofilesurls)),
url(r'^troggle$', views_other.frontpage, name="frontpage"), # control panel. Shows recent actions.
url(r'^caves$', views_caves.caveindex, name="caveindex"),
@@ -142,18 +142,19 @@ actualurlpatterns = [
# {'document_root': settings.PHOTOS_ROOT, 'show_indexes':True}),
# url(r'^site_media/(?P<filepath>.*)$', view_surveys.expofilessingle, name="single"), # MEDIA_ROOT: CSS and JS
url(r'^(site_media/.*)$', flatpage, name="flatpage"), # MEDIA_ROOT: CSS and JS
url(r'^(site_media/.*)$', expopage, name="expopage"), # MEDIA_ROOT: CSS and JS
# url(r'^static/(?P<filepath>.*)$', view_surveys.expofilessingle, name="single"), # MEDIA_ROOT: CSS and JS
url(r'^(static/.*)$', flatpage, name="flatpage"), # STATIC: CSS and JS
url(r'^(static/.*)$', expopage, name="expopage"), # STATIC: CSS and JS
url(r'^(.*)_edit$', editflatpage, name="editflatpage"),
url(r'^(.*)$', flatpage, name="flatpage"), # CATCHALL assumed relative to EXPOWEB, some expofiles getting here..
url(r'^(.*)_edit$', editexpopage, name="editexpopage"),
url(r'^(.*)$', expopage, name="expopage"), # CATCHALL assumed relative to EXPOWEB
]
#Allow DIR_ROOT prefix to all urls
# do not allow DIR_ROOT prefix to all urls
urlpatterns = [
url('^%s' % settings.DIR_ROOT, include(actualurlpatterns))
# url('^%s' % settings.DIR_ROOT, include(trogglepatterns))
url('', include(trogglepatterns))
]
# When apache is running these prempt Django so Django never sees them.