尝试分叉这个带有引导的烧瓶项目并使其启动并运行。我一直遵循指南,直到最后如何设置它,但我收到了以下错误:
File "run.py", line 5, in <module>
app = create_app()
File "/home/xx/flask-bootstrap/app/__init__.py", line 21, in create_app
config = os.path.join(app.root_path, os.environ.get('FLASK_APPLICATION_SETTINGS'))
File "/home/xx/flask-bootstrap/venv/lib/python2.7/posixpath.py", line 75, in join
if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'我已经用pip install -r config/requirements.txt安装了给定的依赖项,但是它会出现一个错误。
在Ubuntu 14.04上,Gnome 3DE。
环境中的pip freeze为我提供了
`Flask==0.10.1
Flask-Assets==0.10
Flask-Bcrypt==0.6.2
Flask-Login==0.2.11
Flask-Script==2.0.5
Flask-SQLAlchemy==2.0
Flask-WTF==0.12
itsdangerous==0.24
Jinja2==2.7.3
jsmin==2.1.2
MarkupSafe==0.23
psycopg2==2.6.1
python-bcrypt==0.3.1
SQLAlchemy==1.0.6
webassets==0.10.1
Werkzeug==0.10.4
wheel==0.24.0
WTForms==2.0.2`发布于 2015-07-15 13:32:16
您会得到错误,因为没有FLASK_APPLICATION_SETTINGS环境变量。
python manage.py -c config/yourconfig.cfg runserver或其他方式传递配置文件FLASK_APPLICATION_SETTINGS设置为指向配置文件
SECRET_KEY配置设置确实是秘密的和加密强的(120+的熵位)make create_cfg将此SECRET_KEY自动设置为配置创建的一部分。发布于 2015-07-15 13:47:47
它是这样运作的:
从virtualenv中,在终端中运行make,在此make create_cfg之后运行。然后make run启动服务器并按预期运行。
https://stackoverflow.com/questions/31431755
复制相似问题