mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 10:37:12 +00:00
gethostname
This commit is contained in:
12
settings.py
12
settings.py
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user