-
Type:
Bug
-
Resolution: Gone away
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 3.4
-
Component/s: Internal
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Hello
I'm trying to connect to mlab cloud mongo db using python 2.7.10
I have install the requried libraries. However when excuted the code below its saying connection refused.
--------------------My Python Code Below----------------------------
from flask import Flask
from flask_pymongo import PyMongo
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'pymongologindb'
app.config['MONGO_URL'] = 'mongodb://xxxxx:yyyyyy@ds255958.mlab.com:55958/pymongologindb'
mongo=PyMongo(app)
@app.route('/add')
def add():
user=mongo.db.users
user.insert({'name':'Atul'})
return 'Added User
if __name__ == '__main__':
app.run(debug=True)