from flask import Flask
from flask.ext.mongoengine import MongoEngine
from views import mocks
import os

app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {
	"db": "mox"
}
app.config["SECRET_KEY"] = "KeepThisS3cr3t"

if os.environ.get('PRODUCTION'):
	app.config["MONGODB_SETTINGS"]["host"] = os.environ.get("PROD_MONGODB")

db = MongoEngine(app)
app.register_blueprint(mocks)

if __name__ == '__main__':
	app.run()
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from views import mocks
import os

app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {
	"db": "mox"
}
app.config["SECRET_KEY"] = "KeepThisS3cr3t"

if os.environ.get('HEROKU') == 1:
	app.config["MONGODB_SETTINGS"]["host"] = os.environ.get("MONGODB_URI")

db = MongoEngine(app)
app.register_blueprint(mocks)

if __name__ == '__main__':
	app.run()
Fix up settings for Heroku
Fix up settings for Heroku

  from flask import Flask
  from flask.ext.mongoengine import MongoEngine
  from views import mocks
  import os
  
  app = Flask(__name__)
  app.config["MONGODB_SETTINGS"] = {
  	"db": "mox"
  }
  app.config["SECRET_KEY"] = "KeepThisS3cr3t"
  
- if os.environ.get('PRODUCTION'):
+ if os.environ.get('HEROKU') == 1:
- 	app.config["MONGODB_SETTINGS"]["host"] = os.environ.get("PROD_MONGODB")
+ 	app.config["MONGODB_SETTINGS"]["host"] = os.environ.get("MONGODB_URI")
  
  db = MongoEngine(app)
  app.register_blueprint(mocks)
  
  if __name__ == '__main__':
  	app.run()
Fix up settings for Heroku
## Code Before:
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from views import mocks
import os

app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {
	"db": "mox"
}
app.config["SECRET_KEY"] = "KeepThisS3cr3t"

if os.environ.get('PRODUCTION'):
	app.config["MONGODB_SETTINGS"]["host"] = os.environ.get("PROD_MONGODB")

db = MongoEngine(app)
app.register_blueprint(mocks)

if __name__ == '__main__':
	app.run()
## Instruction:
Fix up settings for Heroku
## Code After:
from flask import Flask
from flask.ext.mongoengine import MongoEngine
from views import mocks
import os

app = Flask(__name__)
app.config["MONGODB_SETTINGS"] = {
	"db": "mox"
}
app.config["SECRET_KEY"] = "KeepThisS3cr3t"

if os.environ.get('HEROKU') == 1:
	app.config["MONGODB_SETTINGS"]["host"] = os.environ.get("MONGODB_URI")

db = MongoEngine(app)
app.register_blueprint(mocks)

if __name__ == '__main__':
	app.run()