Commits

Anonymous committed 95554b1 Draft

none

Comments (0)

Files changed (3)

 from main_view import main
 
 LOCAL_CONFIG_FILE = "configlocal.json"
-PROD_CONFIG_FILE = "/home/dotcloud/current/config.json"
+PROD_CONFIG_FILE = "config.json"
 
 
 application = Flask(__name__) #it has such name to separate app-name from module has
 def init_settings():
     '''reads configs and initialize api settings object '''
     settings = None
-    if os.path.exists(LOCAL_CONFIG_FILE):
+    if os.environ["RANKADEMY"] == "development":
         data = json.load(open(LOCAL_CONFIG_FILE, 'r'))
         settings = data["settings"]
-    elif os.path.exists(PROD_CONFIG_FILE):
+    elif os.environ["RANKADEMY"] == 'production':
         data = json.load(open(PROD_CONFIG_FILE, 'w'))
         settings = data["settings"]
     else:
  	"MAX_CONTENT_LENGTH": null,
  	"TRAP_HTTP_EXCEPTIONS": false,
  	"DATABASE": {
- 		"host": "mongodb://root:Bwz0xtrih61iry1SvXJY@rankademy-timgluz-db-0.dotcloud.com:20398",
- 		"port": 20398,
+ 		"host": "mongodb://root:zcQjagdt5HeIQPN2zdGu@rankademy-timgluz-db-0.dotcloud.com:20360",
+ 		"port": 20360,
  		"db": "unigo"
  	}	
  }
 import sys
 import os
 
-os.environ['www_settings'] = 'config.json'
-sys.path.append('/home/dotcloud/current')
+d = os.environ
+os.environ.update({"RANKADEMY": "production"})
 
 from app import application