summaryrefslogtreecommitdiffstats
path: root/urls.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-05-20 21:36:05 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-05-20 21:36:05 +0300
commit93201ab458f8854e7c8c3d69f2a172f5ac182139 (patch)
treebd2ebec6e4a513dbecf4780a7feb79a7a4e6977f /urls.py
parent43724f1cf6e51ecc7d2a427511473d7f256dc729 (diff)
downloadtroggle-93201ab458f8854e7c8c3d69f2a172f5ac182139.tar.gz
troggle-93201ab458f8854e7c8c3d69f2a172f5ac182139.tar.bz2
troggle-93201ab458f8854e7c8c3d69f2a172f5ac182139.zip
better layout to understand apache interactions
Diffstat (limited to 'urls.py')
-rw-r--r--urls.py71
1 files changed, 47 insertions, 24 deletions
diff --git a/urls.py b/urls.py
index c7fc81c..a06e7cd 100644
--- a/urls.py
+++ b/urls.py
@@ -217,15 +217,25 @@ trogglepatterns = [
# Prospecting Guide document
re_path(r'^prospecting_guide/$', prospecting), # disabled. Bad links, incompatible image package use and very, very out of date.
-# This next set are all intercepted by Apache, if it is running.
+# This next set are all intercepted by Apache, if it is running, with no problem.
re_path(r'^photos/(?P<subpath>.*)$', mediapage, {'doc_root': settings.PHOTOS_ROOT}, name="mediapage"), # photo galleries
- re_path(r'^site_media/(?P<subpath>.*)$', mediapage, {'doc_root': settings.MEDIA_ROOT}, name="mediapage"), # MEDIA_ROOT: CSS and JS
+ re_path(r'^map/map.html', map, name="map"), # Redirects to OpenStreetMap JavaScript. NOT WORKING
+ re_path(r'^map/(?P<path>.*)$', mapfile, name="mapfile"), # css, js, gpx. NOT WORKING
+
+# This next set are all intercepted by Apache, if it is running, AND troggle must manage these,
+# even though the code is not in the troggle repo
+# Alias /static/ /home/expo/static/
re_path(r'^static/(?P<subpath>.*)$', mediapage, {'doc_root': settings.MEDIA_ROOT}, name="mediapage"), # STATIC only used by admin pages
+# Alias /javascript /usr/share/javascript
path('javascript/<path:subpath>', mediapage, {'doc_root': settings.JSLIB_ROOT}, name="mediapage"), # JSLIB_URL
+
+# NOT intercepted by apache
+ re_path(r'^site_media/(?P<subpath>.*)$', mediapage, {'doc_root': settings.MEDIA_ROOT}, name="mediapage"), # MEDIA_ROOT: CSS and JS
+
+# Fossil ? /loser/caves-1623/171/171.svx fails 404, /loser/docs/smklengths fails 404
re_path(r'^/loser/(?P<subpath>.*)$', mediapage, {'doc_root': settings.SURVEX_DATA}, name="mediapage"), # Oddly not working !?
- re_path(r'^map/map.html', map, name="map"), # Redirects to OpenStreetMap JavaScript
- re_path(r'^map/(?P<path>.*)$', mapfile, name="mapfile"), # css, js, gpx
+
# Helpers to edit HTML
re_path(r'^image_selector/(?P<path>.*)', image_selector, name = 'image_selector'),
@@ -246,24 +256,37 @@ urlpatterns = [re_path('', include(trogglepatterns))]
# When apache is running these prempt Django so Django never sees them.
# NB apache has its own ideas about mimetypes, so behaviour may not be identical for .xml files by troggle
+# These directives are in /home/expo/config/apache/expo.conf on the server
+# checked as correct 3 May 2023.
+
+#These are the critical ones: /static/ and /javascript/
+#Note that apache does NOT intercept /site-media/
+# Alias /static/ /home/expo/static/
+# Alias /javascript /usr/share/javascript
+#
+# Alias /expofiles /home/expo/expofiles
+# Alias /photos /home/expo/webphotos
+# Alias /map /home/expo/expoweb/map
+# Alias /expowebcache /home/expo/expowebcache/
+# Alias /robots.txt /home/expo/static/robots.txt
+# Alias /favicon.ico /home/expo/static/favicon.ico
+
+#This is archaic ?
+# Redirect permanent "/expoimages/" "/expofiles/"
+
+# #kanboard, the trello-clone, but need individual user id to be effective
+# Alias /kanboard /home/expo/kanboard
+
+# #Search function (xapian-omega)
+# ScriptAlias /search /usr/lib/cgi-bin/omega/omega
+
+# ScriptAlias /hgrepositories /home/expo/config/apache/services/hgweb/hgweb.cgi
+
+# #bank of expo
+# #current expedition
+# ScriptAlias "/boe" "/home/expo/boe/boc/boc.pl"
+# #archived expedition boe instances
+# ScriptAliasMatch "^/boe-(.*)" "/home/expo/boe/boc-$1/boc.pl"
+
+
-# NEW apache configurations suggested as of 2 April 2021:
-# Alias /site-media/ /home/expo/troggle/media/
-# Alias /robots.txt /home/expo/troggle/media/robots.txt # does not exist!
-# Alias /favicon.ico /home/expo/troggle/media/favicon.ico # comes from /expoweb/* when running runserver
-# Alias /javascript /home/expo/troggle/media/jslib # empty
-# Alias /search ? # the Xapian text search thinggy
-# Alias /kanboard ? # the Kanban Trello-clone thinggy
-
-# Copy of old standard apache configurations:
-# Alias /expofiles /home/expo/expofiles
-# Alias /photos /home/expo/webphotos
-# Alias /map /home/expo/expoweb/map
-# Alias /javascript /usr/share/javascript # to be changed, see above
-# Alias /robots.txt /home/expo/static/robots.txt # to be changed, see above
-# Alias /favicon.ico /home/expo/static/favicon.ico # to be deleted. favicon.ico now in expoweb/
-# Alias /static/ /home/expo/static/ # only used by Django admin, tinymce
-
-# ScriptAlias /repositories /home/expo/config/apache/services/hgweb/hgweb.cgi # UPDATE this for git
-# ScriptAlias /boe /home/expo/boe/boc/boc.pl
-# ScriptAlias /boe-lastyear /home/expo/boe/boc-previous/boc.pl