forked from expo/troggle
fixed serving expofiles from test server
This commit is contained in:
23
urls.py
23
urls.py
@@ -11,7 +11,7 @@ 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 flatpages import views as flatviews
|
||||
"""This sets the actualurlpatterns[] and urlpatterns[] lists which django uses
|
||||
"""This sets the actualurlpatterns[] and urlpatterns[] lists which django uses
|
||||
to resolve urls - in both directions as these are declarative.
|
||||
|
||||
HOW THIS WORKS
|
||||
@@ -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>.*)$', flatviews.expofiles_redirect, name="expofiles_redirect"), # to expo.survex.com/expofiles
|
||||
url(r'^/*(?P<path>.*)$', flatviews.expofiles_redirect, name="expofiles_redirect"), # to expo.survex.com/expofiles
|
||||
]
|
||||
else:
|
||||
expofilesurls = [
|
||||
url(r'^(?P<filepath>.*)$',view_surveys.expofilessingle, name="single"), # local copy of EXPOFILES
|
||||
url(r'^/*(?P<filepath>.*)$',flatviews.expofilessingle, name="single"), # local copy of EXPOFILES
|
||||
]
|
||||
|
||||
|
||||
actualurlpatterns = [
|
||||
url(r'^expofiles/', include(expofilesurls)),
|
||||
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"),
|
||||
@@ -110,7 +110,6 @@ actualurlpatterns = [
|
||||
url(r'^cave/(?P<cave_id>[^/]+)/qm\.csv/?$', views_other.downloadQMs, name="downloadqms"),
|
||||
url(r'^downloadqms$', views_other.downloadQMs),
|
||||
|
||||
|
||||
# url(r'^map/', .........), # Intercepted by Apache. Yields OpenStreetMap. Redirects to expoweb/map
|
||||
|
||||
url(r'^survexfile/(?P<survex_file>.*?)\.svx$', views_survex.svx, name="svx"),
|
||||
@@ -121,22 +120,20 @@ actualurlpatterns = [
|
||||
url(r'^survexfile/caves/$', views_survex.survexcaveslist, name="survexcaveslist"),
|
||||
url(r'^survexfile/(?P<survex_cave>.*)$', views_survex.survexcavesingle, name="survexcavessingle"),
|
||||
|
||||
# url(r'^survey_files/download/(?P<path>.*)$', view_surveys.download), # needs rewriting
|
||||
|
||||
url(r'^survey_scans/$', view_surveys.surveyscansfolders, name="surveyscansfolders"),
|
||||
url(r'^survey_scans/(?P<path>[^/]+)/$', view_surveys.surveyscansfolder, name="surveyscansfolder"),
|
||||
url(r'^survey_scans/(?P<path>[^/]+)/(?P<file>[^/]+)$',
|
||||
view_surveys.surveyscansingle, name="surveyscansingle"),
|
||||
|
||||
url(r'^tunneldata/$', view_surveys.tunneldata, name="tunneldata"),
|
||||
url(r'^tunneldataraw/(?P<path>.+?\.xml)$', view_surveys.tunnelfile, name="tunnelfile"),
|
||||
url(r'^tunneldataraw/(?P<path>.+?\.xml)$', view_surveys.tunnelfilesingle, name="tunnelfile"),
|
||||
# url(r'^tunneldatainfo/(?P<path>.+?\.xml)$', view_surveys.tunnelfileinfo, name="tunnelfileinfo"),
|
||||
url(r'^tunneldataraw/(?P<path>.+?\.xml)/upload$', view_surveys.tunnelfileupload, name="tunnelfileupload"),
|
||||
|
||||
url(r'^prospecting/(?P<name>[^.]+).png$', prospecting_image, name="prospecting_image"),
|
||||
|
||||
|
||||
# url(r'^javascript/(?P<filepath>.*)$', view_surveys.cssfilessingle, name="single"), # JSLIB_URL - Apache: Alias /javascript /usr/share/javascript
|
||||
# url(r'^javascript/(?P<filepath>.*)$', view_surveys.expofilessingle, name="single"), # JSLIB_URL - Apache: Alias /javascript /usr/share/javascript
|
||||
|
||||
# static views not working, removed as a plugin. Use apache instead to serve these:
|
||||
# url(r'^photos/(?P<path>.*)$', staticviews.serve,
|
||||
@@ -144,17 +141,17 @@ actualurlpatterns = [
|
||||
# url(r'^gallery/(?P<path>.*)$', staticviews.serve,
|
||||
# {'document_root': settings.PHOTOS_ROOT, 'show_indexes':True}),
|
||||
|
||||
# url(r'^site_media/(?P<filepath>.*)$', view_surveys.cssfilessingle, name="single"), # MEDIA_ROOT: CSS and JS
|
||||
# url(r'^site_media/(?P<filepath>.*)$', view_surveys.expofilessingle, name="single"), # MEDIA_ROOT: CSS and JS
|
||||
url(r'^(site_media/.*)$', flatviews.flatpage, name="flatpage"), # MEDIA_ROOT: CSS and JS
|
||||
|
||||
# url(r'^static/(?P<filepath>.*)$', view_surveys.cssfilessingle, name="single"), # MEDIA_ROOT: CSS and JS
|
||||
# url(r'^static/(?P<filepath>.*)$', view_surveys.expofilessingle, name="single"), # MEDIA_ROOT: CSS and JS
|
||||
url(r'^(static/.*)$', flatviews.flatpage, name="flatpage"), # STATIC: CSS and JS
|
||||
|
||||
url(r'^(.*)_edit$', flatviews.editflatpage, name="editflatpage"),
|
||||
url(r'^(.*)$', flatviews.flatpage, name="flatpage"), # files assumed relative to EXPOWEB
|
||||
url(r'^(.*)$', flatviews.flatpage, name="flatpage"), # CATCHALL assumed relative to EXPOWEB, some expofiles getting here..
|
||||
]
|
||||
|
||||
#Allow prefix to all urls
|
||||
#Allow DIR_ROOT prefix to all urls
|
||||
urlpatterns = [
|
||||
url('^%s' % settings.DIR_ROOT, include(actualurlpatterns))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user