flask-react-todo icon indicating copy to clipboard operation
flask-react-todo copied to clipboard

Connection failure

Open Eulerianial opened this issue 7 years ago • 1 comments

Hello,

After installing requirements.txt, I see following errors: Traceback (most recent call last): File "run.py", line 1, in from api import app File "/Users/Riyaaz/Applications/python-react/flask-react-todo/api/init.py", line 11, in db = MongoAlchemy(app) File "/Users/Riyaaz/Applications/python-react/python-react/lib/python2.7/site-packages/flask_mongoalchemy/init.py", line 101, in init self.init_app(app, config_prefix) File "/Users/Riyaaz/Applications/python-react/python-react/lib/python2.7/site-packages/flask_mongoalchemy/init.py", line 123, in init_app host=uri, replicaSet=rs) File "/Users/Riyaaz/Applications/python-react/python-react/lib/python2.7/site-packages/mongoalchemy/session.py", line 126, in connect conn = MongoClient(*args, **kwds) File "/Users/Riyaaz/Applications/python-react/python-react/lib/python2.7/site-packages/pymongo/mongo_client.py", line 378, in init raise ConnectionFailure(str(e)) pymongo.errors.ConnectionFailure: [Errno 61] Connection refused

Do I need to install mongodb first?

Eulerianial avatar Apr 02 '17 13:04 Eulerianial

Yes, you need to install mongodb first.

Your steps are:

  1. install mongodb using your method of choice.
  2. start the mongo server. Either use 'mongod' or 'service mongodb start' in the console.
  3. then follow the instruction in the README to run flask.

if you don't want to install mongodb on your machine, you can use mlab.com to host your database. Then i think you'll have to update flask-react-todo/api/init.py with the server config. Something like this

app.config['MONGOALCHEMY_SERVER']='mlab:server:config'

phamhm avatar Apr 12 '17 17:04 phamhm