Add a getHostname to system
authorSverre Rabbelier <srabbelier@gmail.com>
Mon, 07 Sep 2009 20:02:35 +0200
changeset 2875 abb1e88f9853
parent 2874 fda118f51264
child 2876 b52227d8b423
Add a getHostname to system It is better to abstract how we retrieve the hostname than to access it directly (see also getAppVersion).
app/soc/logic/system.py
--- a/app/soc/logic/system.py	Sat Sep 05 15:56:19 2009 +0200
+++ b/app/soc/logic/system.py	Mon Sep 07 20:02:35 2009 +0200
@@ -26,6 +26,12 @@
 import settings
 
 
+def getHostname():
+  """Returns the hostname
+  """
+
+  return os.environ.get('HTTP_HOST')
+
 def getAppVersion():
   """Returns the Google App Engine "version" of the running instance.
   """