remote /expofiles/ now for runserver dev

This commit is contained in:
Philip Sargent 2021-03-21 01:33:59 +00:00
parent 314f600523
commit 18b570d750
3 changed files with 20 additions and 2 deletions

View File

@ -74,6 +74,16 @@ class SimpleTest(SimpleTestCase):
from django.http import HttpResponse
from django.urls import reverse
def test_import_urls(self):
from django.conf import settings
from django.conf.urls import url, include
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.urls import reverse, resolve
#class SimplePageTest(unittest.TestCase):
class PageTests(TestCase):
@classmethod

View File

@ -1,7 +1,7 @@
import os
import re
from django.shortcuts import render
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.urls import reverse, resolve
from django.template import Context, loader
@ -13,6 +13,11 @@ from troggle.core.models_caves import Cave
import troggle.core.views_caves
import troggle.settings as settings
def expofiles_redirect(request, path):
'''This is used only when running as a test system without a local copy of /expofiles/
'''
return redirect('http://expo.survex.com/expofiles/' + path)
def flatpage(request, path):
#print(" - FLATPAGES delivering the file: {} as MIME type: {}".format(path,getmimetype(path)))
# try:

View File

@ -122,7 +122,10 @@ actualurlpatterns = [
url(r'^prospecting/(?P<name>[^.]+).png$', prospecting_image, name="prospecting_image"),
url(r'^expofiles/(?P<filepath>.*)$', view_surveys.expofilessingle, name="single"), # EXPOFILES
# use this next alternative if no local copy of expofiles.
url(r'^expofiles/(?P<path>.*)$', flatviews.expofiles_redirect, name="expofiles_redirect"), # to expo.survex.com/expofiles
url(r'^expofiles/(?P<filepath>.*)$',view_surveys.expofilessingle, name="single"), # local copy of EXPOFILES
# url(r'^javascript/(?P<filepath>.*)$', view_surveys.cssfilessingle, name="single"), # JSLIB_URL - unused
# static views not working, removed as a plugin. Use apache instead to serve these: