annotation_tools icon indicating copy to clipboard operation
annotation_tools copied to clipboard

You must specify a URI or set the MONGO_URI Flask config variable

Open HailinRen opened this issue 7 years ago • 4 comments

When I try to run , I got the following error, ''' mongo = PyMongo(app) File "/usr/local/lib/python2.7/dist-packages/flask_pymongo/init.py", line 116, in init self.init_app(app, uri, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/flask_pymongo/init.py", line 146, in init_app "You must specify a URI or set the MONGO_URI Flask config variable", ValueError: You must specify a URI or set the MONGO_URI Flask config variable '''

Any help?

HailinRen avatar Jul 09 '18 14:07 HailinRen

I've tried to reproduce your error by messing with my mongodb settings, but I haven't had luck. So a few questions:

  1. Do you have mongodb running?
  2. Have you modified the default_config.py file? This file assumes that your mongodb server can be reached at localhost:27017
  3. What version of pymongo do have?

gvanhorn38 avatar Jul 10 '18 21:07 gvanhorn38

I am using anaconda and have following packages " Flask 1.0.2 Flask-PyMongo 2.0.0 pymongo 3.7.0 " After I add " app.config["MONGO_URI"] = "mongodb://localhost:27017/visipedia_annotation_toolkit" "before mongo = PyMongo(app), then it could work. Thank you for your help!

HailinRen avatar Jul 10 '18 21:07 HailinRen

I am using anaconda and have following packages " Flask 1.0.2 Flask-PyMongo 2.0.0 pymongo 3.7.0 " After I add " app.config["MONGO_URI"] = "mongodb://localhost:27017/visipedia_annotation_toolkit" "before mongo = PyMongo(app), then it could work. Thank you for your help!

In which file do we have to add this text? can you please tell the location of the file in Ubuntu.

hemangjoshi37a avatar Aug 21 '22 12:08 hemangjoshi37a