Наткнулся на http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world Дошел до третьего урока, работа с формами. __init__.py
from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
from app import views
config.py
CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
И тут происходит это:
Traceback (most recent call last):
File "/home/ra/flask/run.py", line 4, in <module>
from app import app
File "/home/ra/flask/app/__init__.py", line 7, in <module>
app.config.from_object('config')
File "/usr/local/lib/python2.7/dist-packages/flask/config.py", line 162, in from_object
obj = import_string(obj)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/utils.py", line 424, in import_string
sys.exc_info()[2])
File "/usr/local/lib/python2.7/dist-packages/werkzeug/utils.py", line 406, in import_string
return __import__(import_name)
werkzeug.utils.ImportStringError: import_string() failed for '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:
- 'config' not found.
Original exception:
ImportError: No module named config
[Finished in 1.4s with exit code 1]
[shell_cmd: python -u "/home/ra/flask/run.py"]
[dir: /home/ra/flask]
[path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/lib/jvm/java-7-oracle/bin:/usr/lib/jvm/java-7-oracle/db/bin:/usr/lib/jvm/java-7-oracle/jre/bin]