2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 10:37:12 +00:00

gethostname

This commit is contained in:
2025-01-20 20:42:43 +00:00
parent 7769fa868e
commit 650cee4b0e

View File

@@ -1,5 +1,6 @@
import sys
from datetime import date
from socket import gethostname
"""
Django settings for troggle project.
@@ -12,12 +13,15 @@ https://docs.djangoproject.com/en/dev/ref/settings/
"""
print("* importing troggle/settings.py")
if 'runserver' in sys.argv:
print(">>>>running on dev local runserver<<<<")
DEVSERVER = True
else:
HOSTNAME = gethostname() # "expo" on expo.survex.com
print(f">>>>running on {HOSTNAME}<<<<")
if HOSTNAME == "expo":
# print(">>>>running on expo.survex.com<<<<")
DEVSERVER = False
else:
print(">>>>running on dev machine<<<<")
DEVSERVER = True
EPOCH = date.fromisoformat('1970-01-01')