debug db settings

This commit is contained in:
Ryan Shea
2014-10-27 18:08:02 -04:00
parent 84b60d0cff
commit d561d79a6f
2 changed files with 13 additions and 4 deletions

View File

@@ -16,7 +16,12 @@ from . import app
from mongoengine import connect
from flask.ext.mongoengine import MongoEngine
if 'MONGODB_URI' in app.config:
MONGODB_DB = app.config['MONGODB_URI'].split('/')[-1]
connect(MONGODB_DB, host=app.config['MONGODB_URI'])
"""if 'MONGODB_URI' in app.config:
else:
MONGODB_URI =
"""
#connect(MONGODB_DB, host=app.config['MONGODB_URI'])
db = MongoEngine(app)

View File

@@ -5,7 +5,7 @@
~~~~~
"""
import os
import os, re
if 'DYNO' in os.environ:
# Debugging
@@ -18,12 +18,16 @@ if 'DYNO' in os.environ:
MONGODB_URI = MONGOLAB_URI
parts = re.split(':|/|@|mongodb://', MONGOLAB_URI)
MONGODB_USERNAME, MONGODB_PASSWORD, MONGODB_HOST, MONGODB_PORT, MONGODB_DB = parts
else:
APP_URL = 'localhost:5000'
# Debugging
DEBUG = True
MONGOLAB_URI = 'mongodb://heroku_app31056693:6murjo28mdlii99edk2hho2h86@ds049130.mongolab.com:49130/heroku_app31056693'
# Database
MONGODB_HOST = 'localhost'
MONGODB_PORT = 27017