update deprecations etc

This commit is contained in:
Philip Sargent 2022-12-23 22:13:11 +00:00
parent 9c39c9dcff
commit a71c616afd
3 changed files with 47 additions and 35 deletions

View File

@ -47,7 +47,7 @@ PV = "python" + str(sys.version_info.major) + "." + str(sys.version_info.minor)
# --------------------- MEDIA redirections BEGIN --------------------- # --------------------- MEDIA redirections BEGIN ---------------------
REPOS_ROOT_PATH = Path(__file__).parent.parent REPOS_ROOT_PATH = Path(__file__).parent.parent
LIBDIR = REPOS_ROOT_PATH / 'lib' / PV LIBDIR = REPOS_ROOT_PATH / 'lib' / PV
#LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.9' # should be finding this automatically: python --version etc. #LIBDIR = REPOS_ROOT_PATH / 'lib' / 'python3.9'
TROGGLE_PATH = Path(__file__).parent TROGGLE_PATH = Path(__file__).parent
TEMPLATE_PATH = TROGGLE_PATH / 'templates' TEMPLATE_PATH = TROGGLE_PATH / 'templates'
@ -55,7 +55,8 @@ MEDIA_ROOT = TROGGLE_PATH / 'media'
JSLIB_ROOT = TROGGLE_PATH / 'media' / 'jslib' # used for CaveViewer JS utility JSLIB_ROOT = TROGGLE_PATH / 'media' / 'jslib' # used for CaveViewer JS utility
#FILES = Path('/mnt/d/expofiles/') #FILES = Path('/mnt/d/expofiles/')
EXPOFILES = Path('/mnt/d/EXPO/expofiles/') EXPOFILES = REPOS_ROOT_PATH / "expofiles"
SCANS_ROOT = EXPOFILES / 'surveyscans' SCANS_ROOT = EXPOFILES / 'surveyscans'
PHOTOS_ROOT = EXPOFILES / 'photos' PHOTOS_ROOT = EXPOFILES / 'photos'
PHOTOS_YEAR = "2022" PHOTOS_YEAR = "2022"
@ -64,19 +65,18 @@ PHOTOS_YEAR = "2022"
# trailing slash if there is a path component (optional in other cases). # trailing slash if there is a path component (optional in other cases).
MEDIA_URL = '/site-media/' MEDIA_URL = '/site-media/'
DIR_ROOT = ''#this should end in / if a value is given DIR_ROOT = Path('') #this should end in / if a value is given
URL_ROOT = '/' URL_ROOT = '/'
# URL_ROOT = 'http://localhost:'+ SERVERPORT +'/' # URL_ROOT = 'http://localhost:'+ SERVERPORT +'/'
#Note that these constants are not actually used in urls.py, they should be.. #Note that these constants are not actually used in urls.py, they should be..
MEDIA_URL = urllib.parse.urljoin(URL_ROOT , '/site_media/') # and they all need to end with / so using 'Path' doesn't work..
SCANS_URL = urllib.parse.urljoin(URL_ROOT , '/survey_scans/') MEDIA_URL = Path(URL_ROOT , '/site_media/')
PHOTOS_URL = urllib.parse.urljoin(URL_ROOT , '/photos/') PHOTOS_URL = Path(URL_ROOT , '/photos/')
SVX_URL = urllib.parse.urljoin(URL_ROOT , '/survex/')
STATIC_URL = urllib.parse.urljoin(URL_ROOT , '/static/') # used by Django admin pages. Do not delete. STATIC_URL = Path(URL_ROOT , '/static/') # used by Django admin pages. Do not delete.
JSLIB_URL = urllib.parse.urljoin(URL_ROOT , '/javascript/') # used for CaveViewer JS utility JSLIB_URL = Path(URL_ROOT , '/javascript/') # used for CaveViewer JS utility
#STATIC_ROOT removed after merging content into MEDIA_ROOT. See urls.py & core/views/surveys.py #STATIC_ROOT removed after merging content into MEDIA_ROOT. See urls.py & core/views/surveys.py
# --------------------- MEDIA redirections END --------------------- # --------------------- MEDIA redirections END ---------------------
@ -92,7 +92,7 @@ SURVEXPORT = 'survexport' # for parsing .3d files and producing .pos files
DBSQLITE = { DBSQLITE = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME' : 'troggle.sqlite', 'NAME' : '/home/philip/p11d5/troggle.sqlite',
# 'NAME' : ':memory:', # 'NAME' : ':memory:',
'USER' : 'expo', # Not used with sqlite3. 'USER' : 'expo', # Not used with sqlite3.
'PASSWORD' : 'sekrit', # Not used with sqlite3. 'PASSWORD' : 'sekrit', # Not used with sqlite3.
@ -122,11 +122,9 @@ if DBSWITCH == "mariadb":
NOTABLECAVESHREFS = [ "290", "291", "359", "264", "258", "204", "76", "107"] NOTABLECAVESHREFS = [ "290", "291", "359", "264", "258", "204", "76", "107"]
PYTHON_PATH = REPOS_ROOT_PATH / 'troggle' PYTHON_PATH = REPOS_ROOT_PATH / 'troggle'
sys.path.append(os.fspath(REPOS_ROOT_PATH))
sys.path.append(os.fspath(PYTHON_PATH))
LOGFILE = PYTHON_PATH / 'troggle.log' LOGFILE = PYTHON_PATH / 'troggle.log'
PYTHON_PATH = os.fspath(PYTHON_PATH)
TEMPLATES = [ TEMPLATES = [
{ {
@ -156,9 +154,6 @@ TEMPLATES = [
}, },
] ]
EXPOUSERPASS = "nnn:gggggg - real-expo-password---imported-from-localsettings.py"
EMAIL_HOST_PASSWORD = "real-email-password---imported-from-localsettings.py"
EXPOUSER = 'expo' EXPOUSER = 'expo'
EXPOUSER_EMAIL = 'philip.sargent@gmail.com' EXPOUSER_EMAIL = 'philip.sargent@gmail.com'
EXPOADMINUSER = 'expoadmin' EXPOADMINUSER = 'expoadmin'
@ -172,9 +167,8 @@ DEFAULT_FROM_EMAIL = 'django-test@klebos.net'
SURVEX_DATA = REPOS_ROOT_PATH / "loser" SURVEX_DATA = REPOS_ROOT_PATH / "loser"
DRAWINGS_DATA = REPOS_ROOT_PATH / "drawings" DRAWINGS_DATA = REPOS_ROOT_PATH / "drawings"
EXPOWEB = REPOS_ROOT_PATH / "expoweb" EXPOWEB = REPOS_ROOT_PATH / "expoweb"
#SURVEYS = REPOS_ROOT_PATH
CAVEDESCRIPTIONS = EXPOWEB / "cave_data" CAVEDESCRIPTIONS = EXPOWEB / "cave_data"
ENTRANCEDESCRIPTIONS = EXPOWEB / "entrance_data" ENTRANCEDESCRIPTIONS = EXPOWEB / "entrance_data"
EXPOWEB_URL = '' EXPOWEB_URL = ''
@ -182,15 +176,21 @@ EXPOWEB_URL = ''
# Sanitise these to be strings as all other code is expecting strings # Sanitise these to be strings as all other code is expecting strings
# and we have not made the change to pathlib Path type in the other localsettings-* variants yet. # and we have not made the change to pathlib Path type in the other localsettings-* variants yet.
CAVEDESCRIPTIONS = os.fspath(CAVEDESCRIPTIONS) # CAVEDESCRIPTIONS = str(CAVEDESCRIPTIONS)
ENTRANCEDESCRIPTIONS = os.fspath(ENTRANCEDESCRIPTIONS) # ENTRANCEDESCRIPTIONS = str(ENTRANCEDESCRIPTIONS)
LOGFILE = os.fspath(LOGFILE) # LOGFILE = str(LOGFILE)
#SURVEYS = os.fspath(SURVEYS) # EXPOWEB = str(EXPOWEB)
EXPOWEB = os.fspath(EXPOWEB) # DRAWINGS_DATA = str(DRAWINGS_DATA)
DRAWINGS_DATA = os.fspath(DRAWINGS_DATA) # SURVEX_DATA = str(SURVEX_DATA)
SURVEX_DATA = os.fspath(SURVEX_DATA) # TEMPLATE_PATH = str(TROGGLE_PATH)
REPOS_ROOT_PATH = os.fspath(REPOS_ROOT_PATH) # MEDIA_ROOT = str(MEDIA_ROOT)
TEMPLATE_PATH = os.fspath(TROGGLE_PATH) # JSLIB_ROOT = str(JSLIB_ROOT)
MEDIA_ROOT = os.fspath(MEDIA_ROOT) # SCANS_ROOT = str(SCANS_ROOT)
JSLIB_ROOT = os.fspath(JSLIB_ROOT) # EXPOFILES = str(EXPOFILES)
SCANS_ROOT = os.fspath(SCANS_ROOT) # PHOTOS_ROOT = str(PHOTOS_ROOT)
STATIC_URL = str(STATIC_URL) +"/"
MEDIA_URL = str(MEDIA_URL) +"/"
# PYTHON_PATH = str(PYTHON_PATH)
# REPOS_ROOT_PATH = str(REPOS_ROOT_PATH)
sys.path.append(str(REPOS_ROOT_PATH))
sys.path.append(str(PYTHON_PATH))

View File

@ -1,4 +1,8 @@
/home/philip/zp310d3/lib/python3.10/site-packages/django/utils/asyncio.py:19: DeprecationWarning: There is no current event loop /home/philip/p11d5/lib/python3.11/site-packages/django/http/request.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
import cgi
/home/philip/p11d5/lib/python3.11/site-packages/django/utils/encoding.py:266: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
encoding = locale.getdefaultlocale()[1] or 'ascii'
/home/philip/p11d5/lib/python3.11/site-packages/django/utils/asyncio.py:19: DeprecationWarning: There is no current event loop
event_loop = asyncio.get_event_loop() event_loop = asyncio.get_event_loop()
/home/philip/zp310d3/lib/python3.10/site-packages/django/utils/asyncio.py:19: DeprecationWarning: There is no current event loop /home/philip/p11d5/lib/python3.11/site-packages/django/utils/asyncio.py:19: DeprecationWarning: There is no current event loop
event_loop = asyncio.get_event_loop() event_loop = asyncio.get_event_loop()

View File

@ -1,8 +1,16 @@
asgiref==3.5.2 asgiref==3.5.2
coverage==6.5 attrs==22.2.0
Django==3.2.16 click==8.1.3
colorama==0.4.6
coverage==6.5.0
Django==3.2
docutils==0.19 docutils==0.19
interrogate==1.5.0
Pillow==9.3.0
py==1.11.0
pytz==2022.6 pytz==2022.6
sqlparse==0.4.3
tabulate==0.9.0
toml==0.10.2
typing_extensions==4.4.0 typing_extensions==4.4.0
Unidecode==1.3.6 Unidecode==1.3.6
Pillow==9.3