diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index 85d6c44..f5645be 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -70,7 +70,7 @@ class SimpleTest(SimpleTestCase): def test_import_parses_mix(self): from troggle.parsers.logbooks import GetCaveLookup import troggle.settings - #import troggle.flatpages.models + #import troggle.expopages.models import troggle.logbooksdump import troggle.parsers.caves import troggle.parsers.people diff --git a/core/management/commands/reset_db.py b/core/management/commands/reset_db.py index 2aea94a..c7cfd7a 100644 --- a/core/management/commands/reset_db.py +++ b/core/management/commands/reset_db.py @@ -8,7 +8,7 @@ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from troggle.core.models import Cave, Entrance -import troggle.flatpages.models +import troggle.expopages.models import settings diff --git a/core/view_surveys.py b/core/view_surveys.py index 6aaa9dc..dcec1c2 100644 --- a/core/view_surveys.py +++ b/core/view_surveys.py @@ -9,7 +9,7 @@ from django.shortcuts import render from django.http import HttpResponse, Http404 from troggle.core.models_survex import ScansFolder, SingleScan, SurvexBlock, TunnelFile -from troggle.flatpages import views as flatviews +from troggle.expopages import views as flatviews import parsers.surveys '''Some of these views serve files as binary blobs, and simply set the mime type based on the file extension, diff --git a/databaseReset.py b/databaseReset.py index bf91ccf..34529a5 100644 --- a/databaseReset.py +++ b/databaseReset.py @@ -33,7 +33,7 @@ except: raise print(" - Memory footprint after loading Django: {:.3f} MB".format(resource.getrusage(resource.RUSAGE_SELF)[2]/1024.0)) -import troggle.flatpages.models +import troggle.expopages.models import troggle.core.models import troggle.core.models_survex @@ -97,16 +97,16 @@ def reinit_db(): if django.db.connections.databases['default']['ENGINE'] == 'django.db.backends.sqlite3': with transaction.atomic(): management.call_command('makemigrations','core', interactive=False) - management.call_command('makemigrations','flatpages', interactive=False) + management.call_command('makemigrations','expopages', interactive=False) management.call_command('migrate', interactive=False) management.call_command('migrate','core', interactive=False) - management.call_command('migrate','flatpages', interactive=False) + management.call_command('migrate','expopages', interactive=False) else: management.call_command('makemigrations','core', interactive=False) - management.call_command('makemigrations','flatpages', interactive=False) + management.call_command('makemigrations','expopages', interactive=False) management.call_command('migrate', interactive=False) management.call_command('migrate','core', interactive=False) - management.call_command('migrate','flatpages', interactive=False) + management.call_command('migrate','expopages', interactive=False) print(" - done migration on: " + settings.DATABASES['default']['NAME']) diff --git a/flatpages/__init__.py b/expopages/__init__.py similarity index 100% rename from flatpages/__init__.py rename to expopages/__init__.py diff --git a/flatpages/admin.py b/expopages/admin.py similarity index 60% rename from flatpages/admin.py rename to expopages/admin.py index ddb9ab2..91caa9c 100644 --- a/flatpages/admin.py +++ b/expopages/admin.py @@ -1,4 +1,4 @@ -#from troggle.flatpages.models import Redirect, EntranceRedirect +#from troggle.expopages.models import Redirect, EntranceRedirect from django.contrib import admin # admin.site.register(Redirect) diff --git a/flatpages/migrations/__init__.py b/expopages/migrations/__init__.py similarity index 100% rename from flatpages/migrations/__init__.py rename to expopages/migrations/__init__.py diff --git a/flatpages/models.py b/expopages/models.py similarity index 100% rename from flatpages/models.py rename to expopages/models.py diff --git a/flatpages/views.py b/expopages/views.py similarity index 95% rename from flatpages/views.py rename to expopages/views.py index 9ab69de..0567229 100644 --- a/flatpages/views.py +++ b/expopages/views.py @@ -56,15 +56,15 @@ def flatpage(request, path): This is a horrible mess and some code is redundant and unreachable because of urls.py setup ''' - # print(" - FLATPAGES delivering the file: {} as MIME type: {}".format(path,getmimetype(path)),flush=True) + # print(" - EXPOPAGES delivering the file: {} as MIME type: {}".format(path,getmimetype(path)),flush=True) if path.startswith("noinfo") and settings.PUBLIC_SITE and not request.user.is_authenticated(): - # print((" - FLATPAGES redirect to logon: flat path noinfo", path)) + # print((" - EXPOPAGES redirect to logon: flat path noinfo", path)) return HttpResponseRedirect(urljoin(reverse("auth_login"),'?next={}'.format(request.path))) expowebpath = Path(settings.EXPOWEB) if path.endswith("/") or path == "": - # print(" - FLATPAGES the file: {} ENDSWITH ...".format(path)) + # print(" - EXPOPAGES the file: {} ENDSWITH ...".format(path)) try: o = open(os.path.normpath(expowebpath / path / "index.html"), "rb") @@ -76,7 +76,7 @@ def flatpage(request, path): except IOError: return render(request, 'pagenotfound.html', {'path': path}) else: - # print(" - FLATPAGES the file: '{}' ...".format(path)) + # print(" - EXPOPAGES the file: '{}' ...".format(path)) if path.startswith('site_media'): # print(" - MEDIA_ROOT: {} ...{}".format(settings.MEDIA_ROOT, path)) path = path.replace("site_media", settings.MEDIA_ROOT) @@ -89,12 +89,12 @@ def flatpage(request, path): # print(" - NO _ROOT: {} ...".format(expowebpath)) filetobeopened = os.path.normpath(expowebpath / path) - # print(" - FLATPAGES full path : {} ...".format(filetobeopened)) + # print(" - EXPOPAGES full path : {} ...".format(filetobeopened)) try: o = open(filetobeopened, "rb") - #print(" - FLATPAGES full path no error: {} ...".format(filetobeopened)) + #print(" - EXPOPAGES full path no error: {} ...".format(filetobeopened)) except IOError: - #print(" - FLATPAGES ERROR: {} ...".format(filetobeopened)) + #print(" - EXPOPAGES ERROR: {} ...".format(filetobeopened)) #o.close() return render(request, 'pagenotfound.html', {'path': path}) @@ -108,7 +108,7 @@ def flatpage(request, path): if m: preheader, headerattrs, head, postheader, bodyattrs, body, postbody = m.groups() else: - return HttpResponse(html + "HTML Parsing failure: Page could not be split into header and body: failed in flatpages.views.py") + return HttpResponse(html + "HTML Parsing failure: Page could not be split into header and body: failed in expopages.views.py") m = re.search(rb"