fix bug : ImportError: module 'demo.config' has no attribute 'Config'
erichard@nb-erichard:~/Developpement/LabelsTower.git$ docker/run_latest.sh instance/init_db.sh
LABELSTOWER_ENV demo.config.Config Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 556, in import_string return getattr(module, obj_name) AttributeError: module 'demo.config' has no attribute 'Config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 558, in import_string raise ImportError(e) ImportError: module 'demo.config' has no attribute 'Config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in File "/work/demo/init.py", line 23, in create_app app.config.from_object(os.environ['LABELSTOWER_ENV']) File "/usr/local/lib/python3.6/site-packages/flask/config.py", line 174, in from_object obj = import_string(obj) File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 563, in import_string ImportStringError, ImportStringError(import_name, e), sys.exc_info()[2] File "/usr/local/lib/python3.6/site-packages/werkzeug/_compat.py", line 147, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.6/site-packages/werkzeug/utils.py", line 558, in import_string raise ImportError(e) werkzeug.utils.ImportStringError: import_string() failed for 'demo.config.Config'. Possible reasons are:
- missing init.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;
Debugged import:
- 'demo' found in '/work/demo/init.py'.
- 'demo.config' found in '/work/demo/config.py'.
- 'demo.config.Config' not found.
Original exception:
ImportError: module 'demo.config' has no attribute 'Config' Error: cannot open "Data.sql"