update push procedure and fix order in pathsreport

This commit is contained in:
Philip Sargent 2021-03-24 20:38:43 +00:00
parent ecbef84c37
commit 2fe2c0515f
4 changed files with 49 additions and 40 deletions

View File

@ -3,7 +3,7 @@ originally created for use on Cambridge University Caving Club (CUCC)expeditions
and licensed under the GNU Lesser General Public License.
Troggle has been forked into two projects. The original one is maintained by Aron Curtis
and is used for Erebus caves. The CUCC variant uses files as the definitive data,
and was used for Erebus caves. The CUCC variant uses files as the definitive data,
not the database and lives at http://expo.survex.com/repositories/troggle/.git/
See copyright notices in
@ -57,7 +57,7 @@ Follow the instructions contained in the file to fill out your settings.
Python3, Django, and Database setup
-----------------------------------
Troggle with python3 requires Django 1.8.19 (16 June 2019)
First version of troggle using python3 required Django 1.8.19 (16 June 2019)
We are now using Django 1.11.29
Read this: https://docs.djangoproject.com/en/3.0/topics/install/
@ -65,7 +65,7 @@ Read this: https://docs.djangoproject.com/en/3.0/topics/install/
We are installing with python3.7.5
Also : https://linuxize.com/post/how-to-install-pip-on-ubuntu-20.04/ ]
Install Django using pip, not with apt.
Install Django using pip, not with apt, on your test system.
Your Linux installation almost certainly already includes python3 and pip3 but
in case it doesn't install those like this:
@ -282,7 +282,7 @@ ScriptAlias /repositories /home/expo/config/apache/services/hgweb/hgweb.cgi
(The last is just for mercurial which will be remoived during 2020).
These two are not necessary as Django will serve these (see urls.py), but
it may be very slightly faster for apache to serve them first:
it may be faster for apache to serve them first:
Alias /expofiles /home/expo/expofiles
Alias /static/ /home/expo/static/

View File

@ -1,6 +1,7 @@
import datetime
import os.path
import re
from collections import OrderedDict
import django.db.models
from django.db.models import Min, Max
@ -18,51 +19,59 @@ import troggle.settings as settings
def pathsreport(request):
pathsdict={}
pathsdict = OrderedDict()
try:
pathsdict = {
# "BOGUS" : settings.BOGUS,
"CAVEDESCRIPTIONS" : settings.CAVEDESCRIPTIONS,
"DIR_ROOT" : settings.DIR_ROOT,
"ENTRANCEDESCRIPTIONS" : settings.ENTRANCEDESCRIPTIONS,
"EXPOUSER_EMAIL" : settings.EXPOUSER_EMAIL,
"EXPOUSERPASS" :"<redacted>",
"EXPOUSER" : settings.EXPOUSER,
"EXPOWEB" : settings.EXPOWEB,
"EXPOWEB_URL" : settings.EXPOWEB_URL,
"FILES" : settings.FILES,
"JSLIB_URL" : settings.JSLIB_URL,
"LOGFILE" : settings.LOGFILE,
"LOGIN_REDIRECT_URL" : settings.LOGIN_REDIRECT_URL,
"MEDIA_ROOT" : settings.MEDIA_ROOT,
"MEDIA_URL" : settings.MEDIA_URL,
"PHOTOS_URL" : settings.PHOTOS_URL,
"PYTHON_PATH" : settings.PYTHON_PATH,
"REPOS_ROOT_PATH" : settings.REPOS_ROOT_PATH,
"ROOT_URLCONF" : settings.ROOT_URLCONF,
"STATIC_URL" : settings.STATIC_URL,
"SURVEX_DATA" : settings.SURVEX_DATA,
"SURVEY_SCANS" : settings.SURVEY_SCANS,
"SURVEYS" : settings.SURVEYS,
"SURVEYS_URL" : settings.SURVEYS_URL,
"THREEDCACHEDIR" : settings.THREEDCACHEDIR,
"TUNNEL_DATA" : settings.TUNNEL_DATA,
"URL_ROOT" : settings.URL_ROOT
# "BOGUS" : str( settings.BOGUS),
"JSLIB_URL" : str( settings.JSLIB_URL),
# "CSSLIB_URL" : str( settings.CSSLIB_URL),
"CAVEDESCRIPTIONS" : str( settings.CAVEDESCRIPTIONS),
"DIR_ROOT" : str( settings.DIR_ROOT),
"ENTRANCEDESCRIPTIONS" : str( settings.ENTRANCEDESCRIPTIONS),
"EXPOUSER_EMAIL" : str( settings.EXPOUSER_EMAIL),
"EXPOUSERPASS" : str("<redacted>"),
"EXPOUSER" : str( settings.EXPOUSER),
"EXPOWEB" : str( settings.EXPOWEB),
"EXPOWEB_URL" : str( settings.EXPOWEB_URL),
"FILES" : str( settings.FILES),
"LOGFILE" : str( settings.LOGFILE),
"LOGIN_REDIRECT_URL" : str( settings.LOGIN_REDIRECT_URL),
"MEDIA_ROOT" : str( settings.MEDIA_ROOT),
"MEDIA_URL" : str( settings.MEDIA_URL),
"PHOTOS_URL" : str( settings.PHOTOS_URL),
"PYTHON_PATH" : str( settings.PYTHON_PATH),
"REPOS_ROOT_PATH" : str( settings.REPOS_ROOT_PATH),
"ROOT_URLCONF" : str( settings.ROOT_URLCONF),
"STATIC_URL" : str( settings.STATIC_URL),
"SURVEX_DATA" : str( settings.SURVEX_DATA),
"SURVEY_SCANS" : str( settings.SURVEY_SCANS),
"SURVEYS" : str( settings.SURVEYS),
"SURVEYS_URL" : str( settings.SURVEYS_URL),
"SURVEXPORT" : str( settings.SURVEXPORT),
"THREEDCACHEDIR" : str( settings.THREEDCACHEDIR),
"TUNNEL_DATA" : str( settings.TUNNEL_DATA),
"URL_ROOT" : str( settings.URL_ROOT)
}
except:
pathsdict["! EXCEPTION !"] = "missing string constant in troggle/settings"
# settings are unique by paths are not
ncodes = len(pathsdict)
bycodeslist = sorted(pathsdict.items())
bycodeslist = sorted(pathsdict.items()) # a list of tuples
bypaths = sorted(pathsdict.values()) # a list
# create a temporary list
bypathslist = []
for p in bypaths:
for k in pathsdict.keys():
if pathsdict[k] == p:
bypathslist.append((p, k))
del pathsdict[k]
break
#bypaths = sorted(bycodeslist, key=bycodeslist[1])
# iterate through the dictionary and append each tuple into the temporary list
for key, value in pathsdict.items():
tmptuple = (key, value)
bypathslist.append(tmptuple)
# bypathslist = sorted(bypathslist)
#f#=or w in bypaths:
# bypathslist[w] = pathsdict[w]
return render(request, 'pathsreport.html', {
"pathsdict":pathsdict,

View File

@ -21,3 +21,4 @@ python3 manage.py check -v 3 --deploy 2>security-warnings.txt >/dev/null
python3 manage.py check -v 3 --deploy
echo ""
echo `tail -1 lines-of-python.txt` non-comment lines of python.
echo `tail -1 lines-of-templates.txt` non-comment lines of HTML templates.

View File

@ -5,4 +5,3 @@ docutils==0.16
Pillow==7.2.0
pytz==2020.1
Unidecode==1.1.1
Unipath==1.1