Commits

Anonymous committed c001875

Added GOOGLE_APPENGINE_PROJECT_ROOT to allow to set effective app engine project root

  • Participants
  • Parent commits de69a92

Comments (0)

Files changed (1)

 import os
 import sys
 
-PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
+if "GOOGLE_APPENGINE_PROJECT_ROOT" in os.environ:
+        # Read location of App Engine .yaml files from OS environment
+        PROJECT_DIR = os.environ["GOOGLE_APPENGINE_PROJECT_ROOT"]
+else:
+        # Defualt to the location of this file
+        PROJECT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 
 # Overrides for os.environ
 env_ext = {'DJANGO_SETTINGS_MODULE': 'settings'}
                     break
         sys.path = extra_paths + sys.path
         from google.appengine.api import apiproxy_stub_map
-
+    
     setup_project()
     from .utils import have_appserver
     if have_appserver: