Closed bomb-on closed 7 years ago
I had the same error message on two occasions. The first was that Eve could not find my settings.py file. The second was an error in the code in my settings.py. The file "settings.py" is a config file, but is compiled using exec and compile functions to load the values in the namespace. If there are any issues you will get the generic message for ConfigException. In my case, I was assigning a variable outside of my auth subclass which was not recognized and caused an error resulting in this exception.
Good luck!
Thanks for all the info, it was very useful indeed!
I was trying to run my tests with the simplest possible configuration in settings.py
(e.g. DOMAIN = {'whatever': {}}
and still not passing settings
to Eve constructor) but it was still failing.
After a bit more of testing and inspecting what's the issue in my case, I found the "problem" - Eve's load_config
method results with wrong path to settings.py
.
So, since this is strictly Eve issue, I will report it in Eve's repo (if someone else didn't do it already).
This is probably related to #15, but in my case I have problem ONLY when running tests with
py.test
.I prepared a simple EVE (v0.5) app which you can clone here.
With the initial commit I am able to run the app with no problems, however running tests ends up with mentioned exception... Full stack trace looks like this:
As mentioned in #15, simple workaround is to create a dictionary with the
DOMAIN
in it and pass it to the constructor (you can try it out in the second commit in my repo).@mandarvaze mentioned that he had the same problem, but apparently his
DOMAIN
definition was wrong. It seems to me that this is not the case in my example, so I wonder if this is a "known issue" or am I doing something wrong here?