我已经在服务器上安装了所有Flask和其他必需的软件包。
当我运行app.py时,它会显示此消息
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://0.0.0.0:1025/ (Press CTRL+C to quit)
* Restarting with stat
/usr/local/lib/python3.5/dist-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.3.0) doesn't match a supported version!
RequestsDependencyWarning)
gensim Version: 3.6.0
[nltk_data] Downloading package punkt to /home/ubuntu/nltk_data...
[nltk_data] Package punkt is already up-to-date!
[nltk_data] Downloading package stopwords to /home/ubuntu/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
* Debugger is active!
* Debugger PIN: 267-705-778
但是当我打开此页面
x.x.x.x:1025
它只是继续加载。和应用程序无法打开。
此代码在我的本地计算机上运行良好,
flask.app的代码段
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
@app.route("/", methods=['POST','GET'])
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run(host="0.0.0.0", port=1025,debug = True)