Permalink
Browse files

Fixed the DB urls to include DB

  • Loading branch information...
thesteve0 committed Dec 3, 2012
1 parent 854fe47 commit 7bafc8c3f7c5e007fd175a76bddfb231c8bc65ec
Showing with 4 additions and 4 deletions.
  1. +4 −4 wsgi/myflaskapp.py
View
@@ -15,7 +15,7 @@
@app.route("/ws/parks")
def parks():
#setup the connection
- conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL'])
+ conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL']+ os.environ['OPENSHIFT_APP_NAME'])
db = conn.parks
#query the DB for all the parkpoints
@@ -29,7 +29,7 @@ def parks():
@app.route("/ws/parks/park/<parkId>")
def onePark(parkId):
#setup the connection
- conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL'])
+ conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL']+ os.environ['OPENSHIFT_APP_NAME'])
db = conn.parks
#query based on the objectid
@@ -43,7 +43,7 @@ def onePark(parkId):
@app.route("/ws/parks/near")
def near():
#setup the connection
- conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL'])
+ conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL']+ os.environ['OPENSHIFT_APP_NAME'])
db = conn.parks
#get the request parameters
@@ -61,7 +61,7 @@ def near():
@app.route("/ws/parks/name/near/<name>")
def nameNear(name):
#setup the connection
- conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL'])
+ conn = pymongo.Connection(os.environ['OPENSHIFT_MONGODB_DB_URL']+ os.environ['OPENSHIFT_APP_NAME'])
db = conn.parks
#get the request parameters

0 comments on commit 7bafc8c

Please sign in to comment.