Flask cli can't import application set with FLASK_APP

前端 未结 2 535
逝去的感伤
逝去的感伤 2021-01-19 06:06

Following the Flask 0.11 documentation, I cloned the Flask repo, created a virtualenv, and installed Flask via pip install flask. I went into the example

相关标签:
2条回答
  • 2021-01-19 06:38

    Flask issue for the eclipse and PyDev extension, you can set a path like this. Flask 1.0.2 and Python 3.6 already installed on Windows 10.

    flask.cli.NoAppException
    flask.cli.NoAppException: module 'src' has no attribute 'Hello'
    

    Run Flask in proper folder path to resolve this issue.

    0 讨论(0)
  • 2021-01-19 06:51

    I was setting FLASK_APP=flaskr. Since I hadn't installed my app as a package in my virtualenv, I needed to add the .py extension.

    export FLASK_APP=flaskr.py
    
    0 讨论(0)
提交回复
热议问题