How Do You Troubleshoot the Error “eve.exceptions.ConfigException: DOMAIN dictionary missing or wrong.”?

Problem scenario
You are trying to use Python Eve.  You are using Python's interactive command prompt, and you run these two commands:

from eve import Eve
app = Eve()

But you get this error:

"File "/usr/local/lib/python2.7/dist-packages/eve/flaskapp.py", line 138, in __init__
    self.validate_domain_struct()
  File "/usr/local/lib/python2.7/dist-packages/eve/flaskapp.py", line 269, in validate_domain_struct
    raise ConfigException('DOMAIN dictionary missing or wrong.')
eve.exceptions.ConfigException: DOMAIN dictionary missing or wrong."

What should you do?

Solution
Run these three commands instead of the two above:

contint = {'MONGO_HOST': 'localhost', 'MONGO_PORT': 27017, 'MONGO_DBNAME': 'the_db_name', 'DOMAIN': {'contacts': {}}}
from eve import Eve
app = Eve(settings=contint)

# Now you can run app.run()

We based this solution from this page.

Leave a comment

Your email address will not be published. Required fields are marked *